Monday, March 1, 2010

Android Memory Problem

I've problem with memory of the bitmaps,
I'm creating a lot of bitmaps and then releasing them by recycle() and
after many retries I get:

java.lang.OutOfMemoryError: bitmap size exceeds VM budget

How to get rid of this???
The problem is that even if i close the activity (call onDestroy()),
in next program run the bitmap memory is still allocated!!!! (I've
also android:clearTaskOnLaunch="true" in my manifest).
This is horrible. Can anybody help me with that?
I suspect that every application using BitmapFactory.decodeResource
must get this exception in some call!
Do you have any idea what's going on?