本文整理汇总了Java中com.google.android.apps.dashclock.ExtensionManager类的典型用法代码示例。如果您正苦于以下问题:Java ExtensionManager类的具体用法?Java ExtensionManager怎么用?Java ExtensionManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExtensionManager类属于com.google.android.apps.dashclock包,在下文中一共展示了ExtensionManager类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onAvailableExtensionsChanged
import com.google.android.apps.dashclock.ExtensionManager; //导入依赖的package包/类
@Override
public void onAvailableExtensionsChanged() {
Log.d(TAG, "Available extensions has changed. Updating");
super.onAvailableExtensionsChanged();
List<ComponentName> active = ExtensionManager.getInstance(mService).getInternalActiveExtensionNames();
Set<ComponentName> worldReadableExtensions = new HashSet<>();
for (ExtensionListing info : getAvailableExtensions(!areNonWorldReadableExtensionsVisible())) {
if (active.contains(info.componentName())) {
worldReadableExtensions.add(info.componentName());
mService.update(info.componentName(), getExtensionData(info.componentName()));
}
}
listenTo(worldReadableExtensions);
}
示例2: onCreate
import com.google.android.apps.dashclock.ExtensionManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set up helper components
mExtensionManager = ExtensionManager.getInstance(getActivity());
mExtensionManager.addOnChangeListener(this);
if (savedInstanceState == null) {
// TODO: should load in the correct order
mSelectedExtensions = mExtensionManager.getInternalActiveExtensionNames();
} else {
List<String> selected = savedInstanceState
.getStringArrayList(SAVE_KEY_SELECTED_EXTENSIONS);
for (String s : selected) {
mSelectedExtensions.add(ComponentName.unflattenFromString(s));
}
}
mSelectedExtensionsAdapter = new ExtensionListAdapter();
repopulateAvailableExtensions();
IntentFilter packageChangeIntentFilter = new IntentFilter();
packageChangeIntentFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
packageChangeIntentFilter.addAction(Intent.ACTION_PACKAGE_CHANGED);
packageChangeIntentFilter.addAction(Intent.ACTION_PACKAGE_REPLACED);
packageChangeIntentFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
packageChangeIntentFilter.addDataScheme("package");
getActivity().registerReceiver(mPackageChangedReceiver, packageChangeIntentFilter);
}
示例3: onCreate
import com.google.android.apps.dashclock.ExtensionManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set up helper components
mExtensionManager = ExtensionManager.getInstance(getActivity());
mExtensionManager.addOnChangeListener(this);
if (savedInstanceState == null) {
mSelectedExtensions = mExtensionManager.getActiveExtensionNames();
} else {
List<String> selected = savedInstanceState
.getStringArrayList(SAVE_KEY_SELECTED_EXTENSIONS);
for (String s : selected) {
mSelectedExtensions.add(ComponentName.unflattenFromString(s));
}
}
mSelectedExtensionsAdapter = new ExtensionListAdapter();
repopulateAvailableExtensions();
IntentFilter packageChangeIntentFilter = new IntentFilter();
packageChangeIntentFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
packageChangeIntentFilter.addAction(Intent.ACTION_PACKAGE_CHANGED);
packageChangeIntentFilter.addAction(Intent.ACTION_PACKAGE_REPLACED);
packageChangeIntentFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
packageChangeIntentFilter.addDataScheme("package");
getActivity().registerReceiver(mPackageChangedReceiver, packageChangeIntentFilter);
}
示例4: DashClockRenderer
import com.google.android.apps.dashclock.ExtensionManager; //导入依赖的package包/类
protected DashClockRenderer(Context context) {
mContext = context;
mExtensionManager = ExtensionManager.getInstance(context);
}