tags:

views:

190

answers:

1

Hi, i am facing a problem of OutOfMemoryError that is bitmap size exceeds vm budget while changing the orientation of the Droid mobile (but not in any of other mobiles like Android normal and Android small).I am displaying 10 images in gridview, each one size is less than 20kb.

If i insert 6 images then it doesn't arise that error.

How can i resolve this problem, any one please solve this problem. Thanks

+6  A: 

Ensure two things:
1. Make sure you are not leaking memory. More info here http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html
2. Reduce the Bitmap memory. Check if downsampling Bitmaps in an option. More info here http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue/823966#823966.

Check SO for "Handling large Bitmaps" and "OutOfMemoryError" I am sure that are plenty of discussions that can help you here.

Samuh
thanks to Fedor for adding the links! :)
Samuh