file:///android_asset does not work

android, android-assets

Solution

I think the URI usage is something like this for assests folder

String imageUri = "assets://image.png";
imageLoader.displayImage(imageUri, imageView);

Just check this reference

So your change your code something like this

ImageLoader.getInstance().displayImage(String.format("assets:///img/categories/%d.JPG", category.getId()), mImageIv);

or even load it from SDCard like this

String imageUri = "file:///mnt/sdcard/image.png"; 

Let me know if this works

Problem

I store the images in assets/img/categories folder and trying to load them with this code: ``` ImageLoader.getInstance().displayImage(String.format("file:///android_asset/img/categories/%d.JPG", category.getId()), mImageIv); ``` It seems to be OK, but does not work: ``` E/ImageLoader(28790): /android_asset/img/categories/9.JPG: open failed: ENOENT (No such file or directory) E/ImageLoader(28790): java.io.FileNotFoundException: /android_asset/img/categories/9.JPG: open failed: ENOENT (No such file or directory) ``` Why it does not work?

Original source