android.app.Activity.onTrimMemory()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中android.app.Activity.onTrimMemory()方法的一些代码示例,展示了Activity.onTrimMemory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.onTrimMemory()方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:onTrimMemory

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);
   }
  }
 }
}

相关文章

Activity类方法