diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2015-09-09 23:17:23 +0200 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2015-09-09 23:17:23 +0200 |
commit | cbacd4863a635fc3d8fb9f4da3398f06b5573a1e (patch) | |
tree | 930a21ac1283443f40dc40ca154eea97bba6175d /app/src/main | |
parent | 4697607e926898afac3c81d5c9e46d2a1c05f5bd (diff) | |
download | AntennaPod-cbacd4863a635fc3d8fb9f4da3398f06b5573a1e.zip |
Let Glide trim memory when system asks AP to do so
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 7f3e2399f..9caa35b5b 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -1,5 +1,6 @@ package de.danoeh.antennapod.activity; +import android.annotation.TargetApi; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; @@ -9,6 +10,7 @@ import android.content.res.Configuration; import android.database.DataSetObserver; import android.media.AudioManager; import android.os.AsyncTask; +import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.support.v4.app.Fragment; @@ -27,6 +29,8 @@ import android.view.View; import android.widget.AdapterView; import android.widget.ListView; +import com.bumptech.glide.Glide; + import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.Validate; @@ -482,6 +486,20 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity } } + + @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) + @Override + public void onTrimMemory(int level) { + super.onTrimMemory(level); + Glide.get(this).trimMemory(level); + } + + @Override + public void onLowMemory() { + super.onLowMemory(); + Glide.get(this).clearMemory(); + } + @Override public boolean onOptionsItemSelected(MenuItem item) { if (drawerToggle.onOptionsItemSelected(item)) { |