android.appwidget.AppWidgetManager源码实例Demo

类android.appwidget.AppWidgetManager源码实例Demo

下面列出了android.appwidget.AppWidgetManager 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: ministocks   文件: ConfigureActivityBase.java
private void setupWidget(int size) {
    // Update the widget when we end configuration
    Bundle extras = getIntent().getExtras();
    if (extras != null) {
        int appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
        Intent resultValue = new Intent();
        resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
        setResult(RESULT_OK, resultValue);

        WidgetRepository widgetRepository = new AndroidWidgetRepository(getBaseContext());
        widgetRepository.addWidget(appWidgetId, size);
        WidgetProviderBase.updateWidgetAsync(getApplicationContext(), appWidgetId,
                WidgetProviderBase.UpdateType.VIEW_UPDATE);
    }
    finish();
}
 
源代码2 项目: isu   文件: Widgetv.java
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
    super.onUpdate(context, appWidgetManager, appWidgetIds);
    boolean su = Tools.SuVersionBool(Tools.SuVersion(context));
    for (int appWidgetId: appWidgetIds) {
        RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_layoutv);
        if (su) {
            remoteViews.setOnClickPendingIntent(R.id.iSuMain, getPendingSelfIntent(context, ACTION_SU));
            remoteViews.setOnClickPendingIntent(R.id.iSuMonitor, getPendingSelfIntent(context, ACTION_SELINUX));
        } else {
            remoteViews.setTextViewText(R.id.iSuMain, context.getString(R.string.not_available));
            remoteViews.setTextViewText(R.id.iSuMonitor, context.getString(R.string.not_available));
        }
        appWidgetManager.updateAppWidget(appWidgetId, remoteViews);
    }
    if (su)
        Tools.updateAllWidgets(true, context, R.layout.widget_layoutv, Widgetv.class);
    Tools.closeSU();
}
 
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager,
                     int[] appWidgetIds) {

    RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.custom_view_futurestudio);

    appWidgetTarget = new AppWidgetTarget(context, remoteViews, R.id.custom_view_image, appWidgetIds) {
        @Override
        public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
            super.onResourceReady(resource, glideAnimation);
        }
    };

    Glide
            .with(context.getApplicationContext())
            .load(GlideExampleActivity.eatFoodyImages[3])
            .asBitmap()
            .into(appWidgetTarget);

    pushWidgetUpdate(context, remoteViews);
}
 
源代码4 项目: LittleFreshWeather   文件: WeatherAppWidget.java
private void renderTime() {
    ComponentName thisWidget = new ComponentName(mContext, WeatherAppWidget.class);
    AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(mContext);
    int[] appWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);
    for (int i = 0; i < appWidgetIds.length; ++i) {
        int appWidgetId = appWidgetIds[i];
        RemoteViews views = new RemoteViews(mContext.getPackageName(), R.layout.app_widget_layout);

        if (mDataDate != null && mDataDate.compareToIgnoreCase(StringUtil.getCurrentDateTime("yyyy-MM-dd")) != 0) {
            views.setTextColor(R.id.tv_app_widget_weather_desc, mContext.getApplicationContext().getResources().getColor(R.color.colorAirFour));
            views.setTextViewText(R.id.tv_app_widget_weather_desc, mContext.getApplicationContext().getString(R.string.data_out_of_date));
        }

        views.setTextViewText(R.id.tv_app_widget_time, StringUtil.getCurrentDateTime("HH:mm"));
        views.setTextViewText(R.id.tv_app_widget_dayofweek, StringUtil.getCurrentDateTime("EEEE"));
        views.setTextViewText(R.id.tv_app_widget_date, StringUtil.getCurrentDateTime("M月d日"));

        appWidgetManager.updateAppWidget(appWidgetId, views);
    }

    renderData(mEntity);

    updateTimeSequence();
    LogUtil.e(TAG, "renderTime");
}
 
源代码5 项目: KernelAdiutor   文件: Widget.java
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
    super.onUpdate(context, appWidgetManager, appWidgetIds);

    for (int appWidgetId : appWidgetIds) {
        Intent svcIntent = new Intent(context, WidgetService.class);
        svcIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
        svcIntent.setData(Uri.parse(svcIntent.toUri(Intent.URI_INTENT_SCHEME)));

        RemoteViews widget = new RemoteViews(context.getPackageName(), R.layout.widget_profile);
        widget.setRemoteAdapter(R.id.profile_list, svcIntent);

        widget.setPendingIntentTemplate(R.id.profile_list, getPendingIntent(context, LIST_ITEM_CLICK));

        appWidgetManager.updateAppWidget(appWidgetId, widget);
    }
}
 
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)
{
	final int widgetCount = appWidgetIds.length;
	
	// Load Data.
	if (mFavorites == null || mFavorites.isEmpty())
	{
		initData(context);
	}
	
	for (int i = 0; i < widgetCount; i++)
	{
		int appWidgetId = appWidgetIds[i];
		updateAppWidget(context, appWidgetManager, appWidgetId);
	}
}
 
源代码7 项目: prayer-times-android   文件: WidgetConfigure.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setResult(RESULT_CANCELED);

    Intent intent = getIntent();
    Bundle extras = intent.getExtras();
    if (extras != null) {
        mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
        mOnlyCity = extras.getBoolean("onlyCity", false);
    }

    if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) {
        finish();
    }

    cityDialog();

}
 
源代码8 项目: WalletCordova   文件: SettingsActivity.java
@Override
public void onStop() {
    super.onStop();
    final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this);

    final ComponentName providerName = new ComponentName(this, WalletBalanceWidgetProvider.class);

    try
    {
        final int[] appWidgetIds = appWidgetManager.getAppWidgetIds(providerName);

        if (appWidgetIds.length > 0)
        {
            WalletBalanceWidgetProvider.runAsyncTask(this, appWidgetManager, appWidgetIds);
        }
    }
    catch (final RuntimeException x)
    {
    }
}
 
源代码9 项目: Torch   文件: TorchWidgetProvider.java
public void updateState(Context context, int appWidgetId) {
    RemoteViews mViews = new RemoteViews(context.getPackageName(), R.layout.widget);
    Intent mStateIntent = context.registerReceiver(null,
            new IntentFilter(TorchSwitch.TORCH_STATE_CHANGED));
    boolean on = mStateIntent != null && mStateIntent.getIntExtra("state", 0) != 0;

    SharedPreferences mPreferences = PreferenceManager.getDefaultSharedPreferences(context);
    String mPrefColor = mPreferences.getString(WidgetActivity.KEY_WIDGET_COLOR, context.getString(R.string.red));
    mViews.setInt(R.id.shape, "setColorFilter", Utils.getPrefColor(context, mPrefColor));

    mViews.setOnClickPendingIntent(R.id.button, getLaunchPendingIntent(context, appWidgetId, 0));

    if (on) {
        mViews.setImageViewResource(R.id.widget, widgetState.ON.getImgDrawable());
    } else {
        mViews.setImageViewResource(R.id.widget, widgetState.OFF.getImgDrawable());
    }

    AppWidgetManager mWidgetManager = AppWidgetManager.getInstance(context);
    mWidgetManager.updateAppWidget(appWidgetId, mViews);
}
 
源代码10 项目: Document-Scanner   文件: WidgetProvider.java
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
    RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);

    Intent configIntent1 = new Intent(context, DocumentScannerActivity.class);
    configIntent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TASK);
    configIntent1.putExtra(DocumentScannerActivity.WidgetCameraIntent, true);

    Intent configIntent2 = new Intent(context, OcrCaptureActivity.class);
    configIntent2.putExtra(OcrCaptureActivity.AutoFocus, true);
    configIntent2.putExtra(OcrCaptureActivity.UseFlash, false);
    configIntent2.putExtra(OcrCaptureActivity.WidgetIntent, true);
    Intent configIntent3 = new Intent(context, GalleryGridActivity.class);

    PendingIntent configPendingIntent1 = PendingIntent.getActivity(context, 0, configIntent1, 0);
    PendingIntent configPendingIntent2 = PendingIntent.getActivity(context, 0, configIntent2, 0);
    PendingIntent configPendingIntent3 = PendingIntent.getActivity(context, 0, configIntent3, 0);

    remoteViews.setOnClickPendingIntent(R.id.wb1home, configPendingIntent1);
    remoteViews.setOnClickPendingIntent(R.id.wb2ocr, configPendingIntent2);
    remoteViews.setOnClickPendingIntent(R.id.wb3gallery, configPendingIntent3);

   appWidgetManager.updateAppWidget(appWidgetIds, remoteViews);

}
 
源代码11 项目: AndroidChromium   文件: BookmarkWidgetProvider.java
@Override
public void onReceive(Context context, Intent intent) {
    // Handle bookmark-specific updates ourselves because they might be
    // coming in without extras, which AppWidgetProvider then blocks.
    final String action = intent.getAction();
    if (getBookmarkAppWidgetUpdateAction(context).equals(action)) {
        AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
        if (intent.hasExtra(AppWidgetManager.EXTRA_APPWIDGET_ID)) {
            performUpdate(context, appWidgetManager,
                    new int[] {IntentUtils.safeGetIntExtra(intent,
                            AppWidgetManager.EXTRA_APPWIDGET_ID, -1)});
        } else {
            performUpdate(context, appWidgetManager,
                    appWidgetManager.getAppWidgetIds(getComponentName(context)));
        }
    } else {
        super.onReceive(context, intent);
    }
}
 
源代码12 项目: AcDisplay   文件: WidgetPickerActivity.java
@SuppressWarnings("NewApi")
private void startAppWidgetConfigure(@NonNull AppWidgetProviderInfo appWidget, int id) {
    try {
        if (Device.hasLollipopApi()) {
            mAppWidgetHost.startAppWidgetConfigureActivityForResult(
                    this, id, 0, REQUEST_APPWIDGET_CONFIGURE, null);
        } else {
            Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
            intent.setComponent(appWidget.configure);
            intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, id);
            startActivityForResult(intent, REQUEST_APPWIDGET_CONFIGURE);
        }
    } catch (Exception e) {
        if (Device.isLge()) {
            CharSequence message = Html.fromHtml(getString(R.string.error_dialog_custom_widget_lg));
            new MaterialDialog.Builder(this)
                    .title(R.string.error_dialog_title)
                    .content(message)
                    .positiveText(android.R.string.ok)
                    .show();
        } else ToastUtils.showLong(this, R.string.error_dialog_title);
    }
}
 
源代码13 项目: SuntimesWidget   文件: WidgetThemeListActivity.java
private void initData(Context context)
{
    data = new SuntimesRiseSetData(context, AppWidgetManager.INVALID_APPWIDGET_ID);   // use app configuration
    data.setCompareMode(WidgetSettings.CompareMode.TOMORROW);
    data.setTimeMode(WidgetSettings.TimeMode.OFFICIAL);
    data.calculate();

    SuntimesRiseSetData noonData = new SuntimesRiseSetData(data);
    noonData.setTimeMode(WidgetSettings.TimeMode.NOON);
    noonData.calculate();
    data.linkData(noonData);
}
 
@Override
public void onReceive(Context context, Intent intent) {
    if (intent.getAction().equals(ExpensesWidgetService.UPDATE_WIDGET)) {
        AppWidgetManager gm = AppWidgetManager.getInstance(context);
        int[] ids = gm.getAppWidgetIds(new ComponentName(context, ExpensesWidgetProvider.class));
        this.onUpdate(context, gm, ids);
    }
}
 
源代码15 项目: Pedometer   文件: WidgetUpdateService.java
@Override
protected void onHandleWork(@NonNull Intent intent) {
    Database db = Database.getInstance(this);
    int steps = Math.max(db.getCurrentSteps() + db.getSteps(Util.getToday()), 0);
    db.close();
    final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this);
    int[] appWidgetIds =
            appWidgetManager.getAppWidgetIds(new ComponentName(this, Widget.class));
    for (int appWidgetId : appWidgetIds) {
        appWidgetManager
                .updateAppWidget(appWidgetId, Widget.updateWidget(appWidgetId, this, steps));
    }
}
 
源代码16 项目: privatelocation   文件: LocationWidgetProvider.java
public void onUpdate(Context context, AppWidgetManager appWidgetManager,
                     int[] appWidgetIds) {

    for (int appWidgetId : appWidgetIds) {
        RemoteViews remoteViews = new RemoteViews(context.getPackageName(),
                R.layout.app_widget);

        //default status
        remoteViews.setTextViewText(R.id.tvWidgetToggle, context.getResources().getString(R.string.widget_start_text));

        Intent intent = new Intent(context, LocationWidgetProvider.class);
        intent.setAction(ACTION_WIDGET_RECEIVER);
        PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 0);

        remoteViews.setOnClickPendingIntent(R.id.llWidget, pendingIntent);

        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
        boolean value = prefs.getBoolean(context.getString(R.string.widget_prefs_service_id), false);

        if (value) {
            SharedPreferences.Editor editor = prefs.edit();
            editor.putBoolean(context.getString(R.string.widget_prefs_service_id), false);
            editor.apply();
        }

        appWidgetManager.updateAppWidget(appWidgetId, remoteViews);
    }
}
 
源代码17 项目: NightWatch   文件: NightWatchWidget.java
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
    final int N = appWidgetIds.length;
    for (int i = 0; i < N; i++) {
        updateAppWidget(context, appWidgetManager, appWidgetIds[i]);
    }
}
 
源代码18 项目: privatelocation   文件: LocationWidgetProvider.java
public void setWidgetStop(Context context) {
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
    prefs.edit().putBoolean(context.getString(R.string.widget_prefs_service_id), false).apply();

    AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
    ComponentName thisWidget = new ComponentName(context, LocationWidgetProvider.class);
    RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.app_widget);

    remoteViews.setTextViewText(R.id.tvWidgetToggle, context.getResources().getString(R.string.widget_start_text));
    remoteViews.setImageViewResource(R.id.ivWidgetLocation, R.drawable.ic_widget_location_off_white_24dp);
    remoteViews.setInt(R.id.llWidget, "setBackgroundResource", R.color.colorWidgetStop);

    appWidgetManager.updateAppWidget(thisWidget, remoteViews);
}
 
源代码19 项目: Weather   文件: SmallWidgetProvider.java
@Override
public void onReceive(Context context, Intent intent) {
    AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
    ComponentName provider = new ComponentName(context.getPackageName(), getClass().getName());
    int ids[] = appWidgetManager.getAppWidgetIds(provider);
    onUpdate(context, appWidgetManager, ids);
}
 
源代码20 项目: CumulusTV   文件: WidgetSelectionActivity.java
private void completeConfiguration() {
    AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this);
    RemoteViews views = new RemoteViews(getPackageName(), R.layout.widget_channel);
    appWidgetManager.updateAppWidget(mAppWidgetId, views);
    Intent resultValue = new Intent();
    resultValue.setAction("android.appwidget.action.APPWIDGET_UPDATE");
    resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
    setResult(RESULT_OK, resultValue);
    ChannelShortcut.updateWidgets(this, ChannelShortcut.class);
    finish();
}
 
public static void forceWidgetUpdate(Integer widgetId, Context context){
    Intent intent = new Intent(context, WeatherWidgetThreeDayForecast.class);
    intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
    int[] ids;
    if(widgetId == null) {
        ids = AppWidgetManager.getInstance(context).getAppWidgetIds(new ComponentName(context, WeatherWidgetThreeDayForecast.class));
    }else{
        ids = new int[]{widgetId};
    }
    intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, ids);
    context.sendBroadcast(intent);
}
 
源代码22 项目: kcanotify_h5-master   文件: KcaTimerWidget.java
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
    super.onUpdate(context, appWidgetManager, appWidgetIds);

    int layout_id = R.layout.widget_timer;
    for (int i = 0; i < appWidgetIds.length; i++) {
        int widgetId = appWidgetIds[i];
        RemoteViews views = new RemoteViews(context.getPackageName(), layout_id);
        appWidgetManager.updateAppWidget(widgetId, views);
    }
}
 
源代码23 项目: Torch   文件: WidgetActivity.java
@SuppressWarnings("deprecation")
  // No need to go to fragments right now
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);

mActivity = this;
      mContext = this.getApplicationContext();
      mPreferences = PreferenceManager.getDefaultSharedPreferences(this);

      addPreferencesFromResource(R.layout.activity_widget);

      mWidgetProvider = TorchWidgetProvider.getInstance();

      mColor = (ListPreference) findPreference(KEY_WIDGET_COLOR);
      if(mColor.getValue()==null){
          mColor.setValueIndex(0);
      }
      mColor.setSummary(mColor.getValue().toString());
      mColor.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
          @Override
          public boolean onPreferenceChange(Preference preference, Object newValue) {
              preference.setSummary(newValue.toString());
              String mPrefColor = newValue.toString();
              Utils.colorizeBar(mActivity, mContext, mPrefColor);
              return true;
          }
      });

      Bundle extras = getIntent().getExtras();
      if (extras != null) {
          mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,
                  AppWidgetManager.INVALID_APPWIDGET_ID);
      }

      mPreferences.registerOnSharedPreferenceChangeListener(this);
  }
 
源代码24 项目: android   文件: BarWidgetProvider.java
@Override
protected String[] getHijriNames(AppWidgetManager awm, Context context, int appWidgetId) {
    Resources r = context.getResources();

    if (useLongDates(awm, appWidgetId)) {
        return r.getStringArray(R.array.hijri_months);
    } else {
        return r.getStringArray(R.array.hijri_months_short);
    }
}
 
源代码25 项目: Hangar   文件: AppsWidget.java
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
    Tools.HangarLog("onUpdate [" + this.getClass().getCanonicalName() + "]");

    // (re?)start service.  This is specifically so if hangar gets updated the service
    // is restarted
    Intent intent = new Intent(context, WatchfulService.class);
    context.startService(intent);
}
 
源代码26 项目: PowerSwitch_Android   文件: RoomWidgetProvider.java
/**
 * Forces an Update of all Room Widgets
 *
 * @param context any suitable context
 */
public static void forceWidgetUpdate(Context context) {
    // update room widgets
    Intent intent = new Intent(context, RoomWidgetProvider.class);
    intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
    int ids[] = AppWidgetManager.getInstance(context.getApplicationContext())
            .getAppWidgetIds(new ComponentName(context.getApplicationContext(),
                    RoomWidgetProvider.class));
    intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, ids);
    context.sendBroadcast(intent);
}
 
源代码27 项目: TurboLauncher   文件: LauncherModel.java
/**
 * Attempts to find an AppWidgetProviderInfo that matches the given
 * component.
 */
AppWidgetProviderInfo findAppWidgetProviderInfoWithComponent(
		Context context, ComponentName component) {
	List<AppWidgetProviderInfo> widgets = AppWidgetManager.getInstance(
			context).getInstalledProviders();
	for (AppWidgetProviderInfo info : widgets) {
		if (info.provider.equals(component)) {
			return info;
		}
	}
	return null;
}
 
static void updateAppWidget(final Context context, final AppWidgetManager appWidgetManager,
                            final int appWidgetId) {
    final RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.ai_app_widget);
    //views.setTextViewText(R.id.appwidget_text, widgetText);
    final Intent intent = new Intent(context, AISampleAppWidget.class);
    intent.setAction(ACTION_KEY);
    final PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 0);
    views.setOnClickPendingIntent(R.id.appwidget_new_app_widget, pendingIntent);
    // Instruct the widget manager to update the widget
    appWidgetManager.updateAppWidget(appWidgetId, views);
}
 
源代码29 项目: Phonograph   文件: BaseAppWidget.java
/**
 * {@inheritDoc}
 */
@Override
public void onUpdate(final Context context, final AppWidgetManager appWidgetManager,
                     final int[] appWidgetIds) {
    defaultAppWidget(context, appWidgetIds);
    final Intent updateIntent = new Intent(MusicService.APP_WIDGET_UPDATE);
    updateIntent.putExtra(MusicService.EXTRA_APP_WIDGET_NAME, NAME);
    updateIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);
    updateIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
    context.sendBroadcast(updateIntent);
}
 
源代码30 项目: writeily-pro   文件: WidgetConfigure.java
public final void complete(String directory) {
    Intent intent = getIntent();
    Bundle extras = intent.getExtras();
    if (extras != null) {
        mAppWidgetId = extras.getInt(
                AppWidgetManager.EXTRA_APPWIDGET_ID,
                AppWidgetManager.INVALID_APPWIDGET_ID);

        Context context = getApplicationContext();

        // Store widget filter
        SharedPreferences preferences = context.getSharedPreferences("" + mAppWidgetId, MODE_PRIVATE);
        SharedPreferences.Editor editor = preferences.edit();
        editor.putString(Constants.WIDGET_PATH, directory);
        editor.apply();

        Intent resultValue = new Intent(context, FilesWidgetService.class);
        resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
        setResult(RESULT_OK, resultValue);

        Intent i = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE, null, this, WriteilyWidgetProvider.class);
        i.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, new int[]{mAppWidgetId});
        sendBroadcast(i);

        finish();
    }
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 类方法
 同包方法