views:

189

answers:

1

I'm trying to make a basic application that displays an image from the camera, but I when I try to load the .jpg in from the sdcard with BitmapFactory.decodeFile, it returns null.

It doesn't give an out of memory error which I find strange, but the exact same code works fine on smaller images.

How does the generic gallery display huge pictures from the camera with so little memory?

+3  A: 

Try to set the inSampleSize as shown in this example.

Maurits Rijk
You could even try to dynamically choose `inSampleSize` by first using `inJustDecodeBounds` and comparing it to your available space.
CommonsWare