本文整理了Java中android.app.Activity.onTrimMemory()
方法的一些代码示例,展示了Activity.onTrimMemory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.onTrimMemory()
方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:onTrimMemory
暂无
代码示例来源:origin: com.uphyca/android-junit4-robolectric
/**
* @param level
* @see android.app.Activity#onTrimMemory(int)
*/
public void onTrimMemory(int level) {
mActivity.onTrimMemory(level);
}
代码示例来源:origin: iqiyi/Neptune
@Override
public void onTrimMemory(int int0) {
mOriginActivity.onTrimMemory(int0);
}
代码示例来源:origin: edgarvperes/HayaiLauncher
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
if (!mIsCacheClear && level == TRIM_MEMORY_COMPLETE)
clearCaches();
}
代码示例来源:origin: shazam/android-aspects
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
dispatcher.dispatchOnTrimMemory(this, level);
}
代码示例来源:origin: WeAreFairphone/FP2-Launcher
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
if (level >= ComponentCallbacks2.TRIM_MEMORY_MODERATE) {
mAppsCustomizeTabHost.onTrimMemory();
}
}
代码示例来源:origin: fookwood/Launcher3
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
if (level >= ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) {
// The widget preview db can result in holding onto over
// 3MB of memory for caching which isn't necessary.
SQLiteDatabase.releaseMemory();
// This clears all widget bitmaps from the widget tray
// TODO(hyunyoungs)
}
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onTrimMemory(level);
}
}
代码示例来源:origin: klinker24/Android-Blur-Launcher
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
if (level >= ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) {
// The widget preview db can result in holding onto over
// 3MB of memory for caching which isn't necessary.
SQLiteDatabase.releaseMemory();
// This clears all widget bitmaps from the widget tray
// TODO(hyunyoungs)
}
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onTrimMemory(level);
}
}
代码示例来源:origin: klinker24/launcher3
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
if (level >= ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) {
// The widget preview db can result in holding onto over
// 3MB of memory for caching which isn't necessary.
SQLiteDatabase.releaseMemory();
// This clears all widget bitmaps from the widget tray
// TODO(hyunyoungs)
}
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onTrimMemory(level);
}
}
代码示例来源:origin: ELynx/pokemon-go-xposed-mitm
public void onTrimMemory(int arg0) {
if (ScriptLoader.isCalledFromJRuby()) {super.onTrimMemory(arg0); return;}
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: RubotoActivity#onTrimMemory");
{super.onTrimMemory(arg0); return;}
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) {super.onTrimMemory(arg0); return;}
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onTrimMemory}")) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onTrimMemory", arg0);
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_trim_memory}")) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_trim_memory", arg0);
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(true).any?{|m| m.to_sym == :on_trim_memory}")) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_trim_memory", arg0);
} else {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onTrimMemory", arg0);
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!