本文整理匯總了Java中android.appwidget.AppWidgetManager.ACTION_APPWIDGET_CONFIGURE屬性的典型用法代碼示例。如果您正苦於以下問題:Java AppWidgetManager.ACTION_APPWIDGET_CONFIGURE屬性的具體用法?Java AppWidgetManager.ACTION_APPWIDGET_CONFIGURE怎麽用?Java AppWidgetManager.ACTION_APPWIDGET_CONFIGURE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.appwidget.AppWidgetManager
的用法示例。
在下文中一共展示了AppWidgetManager.ACTION_APPWIDGET_CONFIGURE屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configureWidget
private AppWidgetHostView configureWidget(Intent data) {
// Get the selected widget information
Bundle extras = data.getExtras();
int appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
if (appWidgetInfo.configure != null) {
// If the widget wants to be configured then start its configuration activity
Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
intent.setComponent(appWidgetInfo.configure);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
mParent.startActivityForResult(intent, REQUEST_CREATE_APPWIDGET);
} else {
// Otherwise simply create it
return createWidget(data);
}
return null;
}
示例2: configureWidget
/**
* Sets up a widget that the user has selected.
*/
private void configureWidget(int appWidgetId) {
AppWidgetProviderInfo appWidgetInfo =
mAppWidgetManager.getAppWidgetInfo(appWidgetId);
if (appWidgetInfo.configure != null) {
Intent intent =
new Intent(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
intent.setComponent(appWidgetInfo.configure);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
startActivityForResult(intent, 1);
} else {
createWidget(appWidgetId);
}
}
示例3: startConfigActivity
@Override
public void startConfigActivity(AppWidgetProviderInfo info, int widgetId, Activity activity,
AppWidgetHost host, int requestCode) {
Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
intent.setComponent(info.configure);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widgetId);
Utilities.startActivityForResultSafely(activity, intent, requestCode);
}