本文整理汇总了Java中android.content.ComponentCallbacks类的典型用法代码示例。如果您正苦于以下问题:Java ComponentCallbacks类的具体用法?Java ComponentCallbacks怎么用?Java ComponentCallbacks使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ComponentCallbacks类属于android.content包,在下文中一共展示了ComponentCallbacks类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ColorPickerDialog
import android.content.ComponentCallbacks; //导入依赖的package包/类
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);
}
示例2: startNewSession
import android.content.ComponentCallbacks; //导入依赖的package包/类
/**
* Starts a new session for logging.
* @param tabModelSelector A TabModelSelector instance for recording tab counts on page loads.
* If null, UmaSessionStats does not record page loads and tab counts.
*/
public void startNewSession(TabModelSelector tabModelSelector) {
ensureNativeInitialized();
mTabModelSelector = tabModelSelector;
if (mTabModelSelector != null) {
mComponentCallbacks = new ComponentCallbacks() {
@Override
public void onLowMemory() {
// Not required
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
mKeyboardConnected = newConfig.keyboard != Configuration.KEYBOARD_NOKEYS;
}
};
mContext.registerComponentCallbacks(mComponentCallbacks);
mKeyboardConnected = mContext.getResources().getConfiguration()
.keyboard != Configuration.KEYBOARD_NOKEYS;
mTabModelSelectorTabObserver = new TabModelSelectorTabObserver(mTabModelSelector) {
@Override
public void onPageLoadFinished(Tab tab) {
recordPageLoadStats(tab);
}
};
}
nativeUmaResumeSession(sNativeUmaSessionStats);
updatePreferences();
updateMetricsServiceState();
}
示例3: startNewSession
import android.content.ComponentCallbacks; //导入依赖的package包/类
/**
* Starts a new session for logging.
* @param tabModelSelector A TabModelSelector instance for recording tab counts on page loads.
* If null, UmaSessionStats does not record page loads and tab counts.
*/
public void startNewSession(TabModelSelector tabModelSelector) {
ensureNativeInitialized();
mTabModelSelector = tabModelSelector;
if (mTabModelSelector != null) {
mComponentCallbacks = new ComponentCallbacks() {
@Override
public void onLowMemory() {
// Not required
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
mKeyboardConnected = newConfig.keyboard != Configuration.KEYBOARD_NOKEYS;
}
};
mContext.registerComponentCallbacks(mComponentCallbacks);
mKeyboardConnected = mContext.getResources().getConfiguration()
.keyboard != Configuration.KEYBOARD_NOKEYS;
mTabModelSelectorTabObserver = new TabModelSelectorTabObserver(mTabModelSelector) {
@Override
public void onPageLoadFinished(Tab tab) {
recordPageLoadStats(tab);
}
};
}
nativeUmaResumeSession(sNativeUmaSessionStats);
NetworkChangeNotifier.addConnectionTypeObserver(this);
updatePreferences();
updateMetricsServiceState();
}
示例4: registerComponentCallbacks
import android.content.ComponentCallbacks; //导入依赖的package包/类
void registerComponentCallbacks(final CallVoid1<ComponentCallbacks> superCall,
final ComponentCallbacks callback) {
synchronized (mSuperListeners) {
mSuperListeners.push(superCall);
registerComponentCallbacks(callback);
}
}
示例5: unregisterComponentCallbacks
import android.content.ComponentCallbacks; //导入依赖的package包/类
void unregisterComponentCallbacks(final CallVoid1<ComponentCallbacks> superCall,
final ComponentCallbacks callback) {
synchronized (mSuperListeners) {
mSuperListeners.push(superCall);
unregisterComponentCallbacks(callback);
}
}
示例6: startNewSession
import android.content.ComponentCallbacks; //导入依赖的package包/类
/**
* Starts a new session for logging.
* @param tabModelSelector A TabModelSelector instance for recording tab counts on page loads.
* If null, UmaSessionStats does not record page loads and tab counts.
*/
public void startNewSession(TabModelSelector tabModelSelector) {
ensureNativeInitialized();
mTabModelSelector = tabModelSelector;
if (mTabModelSelector != null) {
mComponentCallbacks = new ComponentCallbacks() {
@Override
public void onLowMemory() {
// Not required
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
mKeyboardConnected = newConfig.keyboard != Configuration.KEYBOARD_NOKEYS;
}
};
mContext.registerComponentCallbacks(mComponentCallbacks);
mKeyboardConnected = mContext.getResources().getConfiguration()
.keyboard != Configuration.KEYBOARD_NOKEYS;
mTabModelSelectorTabObserver = new TabModelSelectorTabObserver(mTabModelSelector) {
@Override
public void onPageLoadFinished(Tab tab) {
recordPageLoadStats(tab);
}
};
}
nativeUmaResumeSession(sNativeUmaSessionStats);
updatePreferences();
updateMetricsServiceState();
DefaultBrowserInfo.logDefaultBrowserStats();
}
示例7: registerListener
import android.content.ComponentCallbacks; //导入依赖的package包/类
private void registerListener() {
ContextUtils.getApplicationContext().registerComponentCallbacks(
new ComponentCallbacks() {
@Override
public void onConfigurationChanged(Configuration configuration) {
updateNativeViewConfigurationIfNecessary();
}
@Override
public void onLowMemory() {
}
});
}
示例8: registerListener
import android.content.ComponentCallbacks; //导入依赖的package包/类
private void registerListener() {
mAppContext.registerComponentCallbacks(
new ComponentCallbacks() {
@Override
public void onConfigurationChanged(Configuration configuration) {
updateNativeSharedDisplayInfo();
}
@Override
public void onLowMemory() {
}
});
}
示例9: registerListener
import android.content.ComponentCallbacks; //导入依赖的package包/类
private void registerListener() {
mAppContext.registerComponentCallbacks(
new ComponentCallbacks() {
@Override
public void onConfigurationChanged(Configuration configuration) {
updateNativeSharedDisplayInfo();
}
@Override
public void onLowMemory() {
}
});
}
示例10: registerComponentCallbacks
import android.content.ComponentCallbacks; //导入依赖的package包/类
@Override public void registerComponentCallbacks(final ComponentCallbacks callback) {
if (SDK_INT >= ICE_CREAM_SANDWICH) mApplication.registerComponentCallbacks(callback);
}
示例11: unregisterComponentCallbacks
import android.content.ComponentCallbacks; //导入依赖的package包/类
@Override public void unregisterComponentCallbacks(final ComponentCallbacks callback) {
if (SDK_INT >= ICE_CREAM_SANDWICH) mApplication.unregisterComponentCallbacks(callback);
}
示例12: registerComponentCallbacks
import android.content.ComponentCallbacks; //导入依赖的package包/类
@Override
public void registerComponentCallbacks(ComponentCallbacks callback) {
super.registerComponentCallbacks(callback);
}
示例13: unregisterComponentCallbacks
import android.content.ComponentCallbacks; //导入依赖的package包/类
@Override
public void unregisterComponentCallbacks(ComponentCallbacks callback) {
super.unregisterComponentCallbacks(callback);
}
示例14: registerComponentCallbacks
import android.content.ComponentCallbacks; //导入依赖的package包/类
public void registerComponentCallbacks(ComponentCallbacks callback) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
this.realApplication.registerComponentCallbacks(callback);
}
}
示例15: unregisterComponentCallbacks
import android.content.ComponentCallbacks; //导入依赖的package包/类
public void unregisterComponentCallbacks(ComponentCallbacks callback) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
this.realApplication.unregisterComponentCallbacks(callback);
}
}