当前位置: 首页>>代码示例>>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;未经允许,请勿转载。