本文整理了Java中android.content.Context.registerComponentCallbacks()
方法的一些代码示例,展示了Context.registerComponentCallbacks()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.registerComponentCallbacks()
方法的具体详情如下:
包路径:android.content.Context
类名称: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) {
内容来源于网络,如有侵权,请联系作者删除!