code: public static LottieTask<LottieComposition> fromRawRes(Context context, @RawRes final int rawRes) {
      // Prevent accidentally leaking an Activity.
      final Context appContext = context.getApplicationContext();
      return cache(rawResCacheKey(rawRes), new Callable<LottieResult<LottieComposition>>() {
        @Override public LottieResult<LottieComposition> call() {
          return fromRawResSync(appContext, rawRes);
        }
      });
    }
docs: Parse an animation from raw/res. This is recommended over putting your animation in assets because
  it uses a hard reference to R.
  The resource id will be used as a cache key so future usages won't parse the json again.