0

First I save the image using FileOutPutStream etc..

This should be working since I am able to see the image in the SDCard using 'Astro File Manager'. (The path is also correct according to AFM)

However when I try to load this image as a Bitmap and display it in an ImageViewer I get nothing.

    ImageView image = (ImageView) findViewById(R.id.IMAGE);

    Bitmap bitmap = BitmapFactory.decodeFile(requestList.get(0).getImage());

    image.setImageBitmap(bitmap);

I've checked the byteCount() on the bitmap and it returns a large number so I'm guessing that's fine.

So as I am able to load the file in AFM my guess is that it should be loadable by me as well, but maybe in another way that I'm currently attempting?

The Image is taken from another phones camera, uploaded to a server and then downloaded and stored by my phone. (I believe all of this works though)

David Ekermann
  • 87
  • 3
  • 13

1 Answers1

0

Try this :

BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
Bitmap bitmap = BitmapFactory.decodeFile(photoPath, options);
selected_photo.setImageBitmap(bitmap);
Shivam Verma
  • 7,973
  • 3
  • 26
  • 34