[Android] Free up some space when the system is running low on memory
Ludovic Fauvet
git at videolan.org
Wed Oct 17 12:34:19 CEST 2012
vlc-ports/android | branch: master | Ludovic Fauvet <etix at videolan.org> | Wed Oct 17 12:23:05 2012 +0200| [a16c513b209ffc6d4765973fc2afedc464a75960] | committer: Ludovic Fauvet
Free up some space when the system is running low on memory
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=a16c513b209ffc6d4765973fc2afedc464a75960
---
vlc-android/src/org/videolan/vlc/VLCApplication.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/VLCApplication.java b/vlc-android/src/org/videolan/vlc/VLCApplication.java
index 649ec21..fb4ba56 100644
--- a/vlc-android/src/org/videolan/vlc/VLCApplication.java
+++ b/vlc-android/src/org/videolan/vlc/VLCApplication.java
@@ -27,8 +27,10 @@ import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.preference.PreferenceManager;
+import android.util.Log;
public class VLCApplication extends Application {
+ public final static String TAG = "VLC/VLCApplication";
private static VLCApplication instance;
@Override
@@ -57,6 +59,17 @@ public class VLCApplication extends Application {
}
/**
+ * Called when the overall system is running low on memory
+ */
+ @Override
+ public void onLowMemory() {
+ super.onLowMemory();
+ Log.w(TAG, "System is running low on memory");
+
+ BitmapCache.getInstance().clear();
+ }
+
+ /**
* @return the main context of the Application
*/
public static Context getAppContext()
More information about the Android
mailing list