android.content.Context.registerComponentCallbacks()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(211)

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

Context.registerComponentCallbacks介绍

暂无

代码示例

代码示例来源:origin: bumptech/glide

annotationGeneratedModule.registerComponents(applicationContext, glide, glide.registry);
applicationContext.registerComponentCallbacks(glide);
Glide.glide = glide;

代码示例来源:origin: corcoran/Hangar

public ColorPickerDialog(Context context, int initialColor) {
  super(context);
  context.registerComponentCallbacks(new ComponentCallbacks() {
    @Override
    public void onConfigurationChanged(Configuration newConfig) {
      setUp(mOldColor.getColor(), mNewColor.getColor());
      setAlphaSliderVisible(mAlphaSliderEnabled);
      setHexValueEnabled(mHexValueEnabled);
    }
    @Override
    public void onLowMemory() {
    }
  });
  init(initialColor);
}

代码示例来源:origin: gateship-one/odyssey

@Override
public void onAttach(@NonNull Context context) {
  super.onAttach(context);
  if (null == mComponentCallback) {
    mComponentCallback = new OdysseyComponentCallback();
  }
  // Register the memory trim callback with the system.
  context.registerComponentCallbacks(mComponentCallback);
  // This makes sure that the container activity has implemented
  // the callback interface. If not, it throws an exception
  try {
    mToolbarAndFABCallback = (ToolbarAndFABCallback) context;
  } catch (ClassCastException e) {
    throw new ClassCastException(context.toString() + " must implement ToolbarAndFABCallback");
  }
}

代码示例来源:origin: geniusgithub/AndroidDialer

public static ContactPhotoManager getInstance(Context context) {
  if (sInstance == null) {
    Context applicationContext = context.getApplicationContext();
    sInstance = createContactPhotoManager(applicationContext);
    applicationContext.registerComponentCallbacks(sInstance);
    if (PermissionsUtil.hasContactsPermissions(context)) {
      sInstance.preloadPhotosInBackground();
    }
  }
  return sInstance;
}

代码示例来源:origin: mozilla-tw/Rocket

annotationGeneratedModule.registerComponents(applicationContext, glide, glide.registry);
context.getApplicationContext().registerComponentCallbacks(glide);
Glide.glide = glide;

代码示例来源:origin: derry/delion

mContext.registerComponentCallbacks(mComponentCallbacks);
mKeyboardConnected = mContext.getResources().getConfiguration()
    .keyboard != Configuration.KEYBOARD_NOKEYS;

代码示例来源:origin: iqiyi/Neptune

mHostContext.registerComponentCallbacks(new ComponentCallbacks2() {
  @Override
  public void onTrimMemory(int level) {

相关文章

Context类方法