I receive big image (png, >30Mb) and create bitmap for it. And get java.lang.OutOfMemoryError. I try to catch such exception:
try {
Bitmap bmp = BitmapFactory.decodeStream(someStream);
} catch (OutOfMemoryError e) {
;
}
With 2.2 SDK it works well. But with 2.3 app fails with uncatched exception. I don’t understand, why?
Thanks!
you need to re-size bitmap images before you could use them to display.
Have a look at this tutorial about how to re-size bitmaps.
EDIT
alternatively you could try to save bitmap as file to filesystem using FileOutputStream. Something like this.
decode the bitmap something like this, and scale/resize it as specified in above link.