In which cases should i override onRestored?
Are they just referring to the backup which can be enabled/disabled in the manifest? Is it possible that this method get's called when the app get's updated too? Or under any other circumstances where the appWidgetIds might change? I think the ids are supposed to stay the same forever but not all manufacturers/launchers treat widgets the same way...
Could this be useful against phantom/ghost widgets?
/**
* Called in response to the {@link AppWidgetManager#ACTION_APPWIDGET_RESTORED} broadcast
* when instances of this AppWidget provider have been restored from backup. If your
* provider maintains any persistent data about its widget instances, override this method
* to remap the old AppWidgetIds to the new values and update any other app state that may
* be relevant.
*
* <p>This callback will be followed immediately by a call to {@link #onUpdate} so your
* provider can immediately generate new RemoteViews suitable for its newly-restored set
* of instances.
*
* {@more}
*
* @param context
* @param oldWidgetIds
* @param newWidgetIds
*/
public void onRestored(Context context, int[] oldWidgetIds, int[] newWidgetIds) {
}