List of usage examples for android.appwidget AppWidgetHost deleteAppWidgetId
public void deleteAppWidgetId(int appWidgetId)
From source file:net.niyonkuru.koodroid.appwidget.WidgetConfigureActivity.java
@Override public void onPause() { super.onPause(); mAlertDialog.dismiss(); // avoid leaking window String action = getIntent().getAction(); if (mResultCode == RESULT_CANCELED && (action != null && action.equals(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE))) { /* avoid phantom widgets */ AppWidgetHost host = new AppWidgetHost(this, 1); host.deleteAppWidgetId(mAppWidgetId); } else {//from w ww.j a va 2 s . c o m Intent intent = IntentUtils.createWidgetIntent(this, AppWidgetManager.ACTION_APPWIDGET_UPDATE); intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, new int[] { mAppWidgetId }); sendBroadcast(intent); } }