Created
October 28, 2021 23:50
-
-
Save eric-romero/d778f3ce735c79e616a980b481e19b4d to your computer and use it in GitHub Desktop.
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
class MyActivity : Activity() { | |
override fun onTrimMemory(level: Int) { | |
super.onTrimMemory(level) | |
// Intermediate levels may be added later, so use ranged conditionals | |
if (level >= TRIM_MEMORY_COMPLETE || | |
level in TRIM_MEMORY_RUNNING_CRITICAL until TRIM_MEMORY_UI_HIDDEN) { | |
imageCache.clear() | |
webAppMgr.onLowMemory(level) | |
eventLogger.reportLowMemory(level) | |
} | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment