My application has a lot of images and sometimes it crashes due to low memory.
I wrote this function that I found on the developer site.
public void onLowM
Here is an example of how I'm using onLowMemory, implemented in MyApplication To clean things up, I do flush memory caches (which is used mainly for images), and google tracker;
@Override
public void onLowMemory() {
super.onLowMemory();
Log.w(TAG, "onLowMemory() -> clearImageCacheFu!!!");
clearImageCacheFu();
dispatchGoogleTracker();
stopGoogleTracker();
}
This may give you an idea to adapt as per your need. hope this helps.