clear bitmap cache before running out of memory

This commit is contained in:
Daniel Gultsch 2015-10-14 22:55:59 +02:00
parent 5f9476448f
commit 30dbf97a1c

View file

@ -673,6 +673,15 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
toggleScreenEventReceiver();
}
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
if (level >= TRIM_MEMORY_COMPLETE) {
Log.d(Config.LOGTAG,"clear cache due to low memory");
getBitmapCache().evictAll();
}
}
@Override
public void onDestroy() {
try {