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
1 changed files with 9 additions and 0 deletions

View File

@ -673,6 +673,15 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
toggleScreenEventReceiver(); 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 @Override
public void onDestroy() { public void onDestroy() {
try { try {