Code example for AppWidgetHost

Methods: deleteAppWidgetId

0
        editor.putString(Constants.KEY_SCRAP_LIST, item.getScrapList());
        editor.commit();
    } 
     
    public static void removeWidget(Context context, int appWidgetId) {
        AppWidgetHost host = new AppWidgetHost(context, 1);
        host.deleteAppWidgetId(appWidgetId);
    } 
 
    @Override 
    public void onUpdate(Context context, AppWidgetManager awm, int[] appWidgetIds) {
        if (DEBUG) Log.d(TAG, "onUpdate");
        super.onUpdate(context, awm, appWidgetIds);
    } 
 
    @Override 
    public void onDeleted(Context context, int[] appWidgetIds) {
        if (DEBUG) Log.d(TAG, "onDeleted");
        removePreviousAlarm(); 
        super.onDeleted(context, appWidgetIds);
Stop searching for code, let great code find you!  Add Codota to your java IDE