本文整理匯總了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);
}
}