I know how to read the gif image in local package assets directory. But now I need read other gif image in other package assets. for example the main APP com.aaa.app to read the com.bbb.app gif in assets. I know use
try {
context = this.createPackageContext("com.bbb.app",
Context.CONTEXT_IGNORE_SECURITY);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
AssetManager am = context.getResources().getAssets();
try {
InputStream is = am.open(fileName);
image = BitmapFactory.decodeStream(is);
is.close();
} catch (IOException e) {
e.printStackTrace();
}
to read jpg/png, but I want to read gif use Fresco lib. Anyone know how to do it?
once you have the uri of the gif, do this to load it with fresco
At the moment, Fresco supports the following:
Which gets translated into:
Don't forget to add this to your
build.gradle
: