Android: Display Image from SD CARD

I would rather use a BitmapFactory to decode the Image from the file-path:

Bitmap bitmap = BitmapFactory.decodeFile(imageFile.getAbsolutePath());
jpgView.setImageBitmap(bitmap);

The Docs say:

If the specified file name is null, or cannot be decoded into a
bitmap, the function returns null.

Can you check if the code works with another image and if you can open your image on your PC thought. Maybe the file is corrupt.

Leave a Comment