I am confused why it is happening because my little knowledge says it should not happen. I have couple of images stored in android asset directory in apk in fact in some directory structure like:
Assets --> aphotos --> launch50 ---> launch501.jpg
Now for example I want to set an image to an imageview widget pro grammatically like following: -
Uri uri = Uri.parse("file:///android_asset/"+context.getString(R.string.photoroot)+"/"+fldr+"/"+introphoto);
System.out.println("Image URI: "+uri.toString());
imageView.setImageURI(uri);
where "fldr" and "introphoto" come from the database. While doing this it generates the following error in "LogCat": -
11-22 19:23:46.689: W/ImageView(12990): Unable to open content: file:///android_asset/aphotos/launch50/launch501.jpg 11-22 19:23:46.689: W/ImageView(12990): java.io.FileNotFoundException: /android_asset/aphotos/launch50/launch501.jpg (No such file or directory) 11-22 19:23:46.689: W/ImageView(12990): at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
Can anybody tell that why it's happening because image is there? Thanks in advance!