Loading images from app assets using the Glide library
I switched my current project from Picasso to Glide. However, I am unable to load the image from the app assets. Is it possible?
Sample code:
String assetPath = "file:///android_asset/flags/FR.jpg";
Glide.with(getContext())
.load(Uri.parse(assetPath))
.placeholder(missingFlagDrawable)
.centerCrop()
.crossFade()
.into(flag);
I have also tried the load (String) method with no success and I don't see a load method like InputStream or FileDescriptor that I could get with the AssetManager class.
This exact code worked in Picasso.
Glide works correctly in the rest of the app and loads nicely deleted images.
+3
source to share
1 answer
Work with Glide.with(xxx).load(xxx).asBitmap()
As stated in the GitHub issues I opened at the time , I ran into this issue.
+2
source to share