Created
December 3, 2015 01:06
-
-
Save ryancford/cd9816b668ab91dd903d to your computer and use it in GitHub Desktop.
Log calls to onTrimMemory().
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onTrimMemory(int level) { | |
super.onTrimMemory(level); | |
String levelString = "TRIM_MEMORY_RUNNING_MODERATE"; | |
switch (level) { | |
case TRIM_MEMORY_RUNNING_MODERATE: levelString = "TRIM_MEMORY_RUNNING_MODERATE"; break; | |
case TRIM_MEMORY_RUNNING_LOW: levelString = "TRIM_MEMORY_RUNNING_LOW"; break; | |
case TRIM_MEMORY_RUNNING_CRITICAL: levelString = "TRIM_MEMORY_RUNNING_CRITICAL"; break; | |
case TRIM_MEMORY_BACKGROUND: levelString = "TRIM_MEMORY_BACKGROUND"; break; | |
case TRIM_MEMORY_MODERATE: levelString = "TRIM_MEMORY_MODERATE"; break; | |
case TRIM_MEMORY_COMPLETE: levelString = "TRIM_MEMORY_COMPLETE"; break; | |
case TRIM_MEMORY_UI_HIDDEN: levelString = "TRIM_MEMORY_UI_HIDDEN"; break; | |
} | |
Logout.debug("MEMORY", "MEMORY LEVEL REPORTED: " + levelString); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment