diff options
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index cfd3ba6e0..f9f9b71e2 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -674,6 +674,15 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa } @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 { unregisterReceiver(this.mEventReceiver); |