Android OutOfMemoryException

Is there a way to process OutOfMemoryExceptionin Android using Bitmap a large number of images. I tried all the solutions given on this site, i.e. (GC, Bitmap.reset ()). I just want to know if any warning can be generated before the heap memory is full? so that I can handle it differently.

+5
source share
1 answer

There is a callback function in your business that you can implement to notify you of low memory problems:

http://developer.android.com/reference/android/content/ComponentCallbacks.html#onLowMemory ()

@Override
public void onLowMemory() {
    super.onLowMemory();

    // Your memory releasing code
}
+6
source

All Articles