// This fires when the homescreen requests an appwidget update. // This is the final fallback when the clock lags. @Override public void onUpdate(Context context, AppWidgetManager aWM, int[] appWidgetIds) { final int N = appWidgetIds.length; for (int i = 0; i < N; i++) { // For a brand new widget (but not established widgets), initialize the prefs if (OMC.PREFS.getString("widgetTheme" + i, "").equals("")) OMC.initPrefs(appWidgetIds[i]); // Redraw the widget. OMCWidgetDrawEngine.updateAppWidget(context, aWM, appWidgetIds[i], OMC.WIDGET2x1CNAME); } }
// When one or more widgets are removed... @Override public void onDeleted(Context context, int[] appWidgetIds) { final int N = appWidgetIds.length; for (int i = 0; i < N; i++) { // Remove Prefs if (OMC.DEBUG) Log.i(OMC.OMCSHORT + "Widget", "Removed Widget #" + appWidgetIds[i]); OMC.removePrefs(appWidgetIds[i]); if (OMC.WIDGETBMPMAP.containsKey(appWidgetIds[i])) { if (!OMC.WIDGETBMPMAP.get(appWidgetIds[i]).isRecycled()) OMC.WIDGETBMPMAP.get(appWidgetIds[i]).recycle(); OMC.WIDGETBMPMAP.remove(appWidgetIds[i]); } } }