This is my code to load Bitmap
into ImageView
from filepath
retrieved from another activity.
I can get file, but Bitmap
is always null
.
I have tried with 250kb image code works fine but it does not work with 1.5MB images.How to resolve this issue?
Logcat message:
skia: --- SkImageDecoder::Factory returned null
Choreographer: Skipped 855 frames! `The application may be doing too much work on its main thread`.
code
Bundle extras = getIntent().getExtras();
if (extras != null) {
String imagepath = extras.getString("FILEPATH1");
File imgFile = new File(imagepath);
if(imgFile.exists()){
Bitmap bitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
imgCaptured.setImageBitmap(bitmap);
}
}
}