當前位置: 首頁>>代碼示例>>Java>>正文


Java AppWidgetManager.ACTION_APPWIDGET_CONFIGURE屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:quaap,項目名稱:LaunchTime,代碼行數:17,代碼來源:Widget.java

示例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);
    }
}
 
開發者ID:jathak,項目名稱:sflauncher,代碼行數:16,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:8,代碼來源:AppWidgetManagerCompatV16.java


注:本文中的android.appwidget.AppWidgetManager.ACTION_APPWIDGET_CONFIGURE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。