diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-09-09 18:37:27 -0400 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-09-09 18:37:27 -0400 |
commit | 2555df3bd21a44b60f70534fab32f4bc19adcb1c (patch) | |
tree | 12dd224fd0cc78f19c05789381e4bf0728f8f66d | |
parent | cde0dfc2905d65fb4e4ea7f2a68f75b76b06aef5 (diff) | |
parent | cbacd4863a635fc3d8fb9f4da3398f06b5573a1e (diff) | |
download | AntennaPod-2555df3bd21a44b60f70534fab32f4bc19adcb1c.zip |
Merge pull request #1190 from mfietz/memory_management
Glide memory management
-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)) { |