I don't know why decodeFile
doesn't work when the param point to a file inside asset folder.
// Load images from the file path
String[] dir = null;
try {
dir = GenericMainContext.sharedContext.getAssets().list("drawable");
// dir Log => [ic.png, ic_info_dark.png, ic_launcher_default.png]
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
for (String uri : dir){
// do your stuff here
if (uri!=null) {
Bitmap bitmap = null;
try {
bitmap = BitmapFactory.decodeFile("file:///android_asset/drawable/"+uri); } catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Any explanation ?