I tried SimpleDraweeView.setImageURI and set a file:///android_asset resource.
xx.setImageURI(Uri.parse("file:///android_asset/....jpg"));
But it shows an error:
can't open '/android_asset/xxx.jpg'
And if I use:
xx.setImageDrawable(new BitmapDrawable(getAssets().open("xxx.jpg")));
This is correct.
I am new to android. Do I make some mistakes? If there are some problems, please let me know. :-)
Can you try asset://...jpg? See http://frescolib.org/docs/supported-uris.html
Thank you, IanChilds. Resolved.
I am sorry that I failed to reach the document.
I use:
Uri.parse("asset:///...")
and solved this problem.
No problem. Hope you find Fresco useful!
I can't load from:
newUrl = "assets://images/common/place_detail/default_place.png";
heap me!
@quynhbk you are using UIL scheme. Fresco one doesn't have s (use asset://);
Fresco should support file:///android_asset/ instead of creating new scheme and don't documented clearly that asset:// scheme is vendor specific.
Picasso: https://github.com/square/picasso/issues/332
Glide: http://stackoverflow.com/questions/29982341/using-glide-for-android-how-do-i-load-images-from-asset-and-resources
+1 to file:///android_asset/
Most helpful comment
@quynhbk you are using UIL scheme. Fresco one doesn't have s (use
asset://);Fresco should support
file:///android_asset/instead of creating new scheme and don't documented clearly thatasset://scheme is vendor specific.Picasso: https://github.com/square/picasso/issues/332
Glide: http://stackoverflow.com/questions/29982341/using-glide-for-android-how-do-i-load-images-from-asset-and-resources