thanks for calling attention to this issue. I will be updating the Android documentation to reflect this.
However, instead of forcing a call to onAppWidgetOptionsChanged() in onUpdate(), we would recommend an approach such as the following:
public class AppWidget extends AppWidgetProvider {
....
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager,
int[] appWidgetIds) {
super.onUpdate(context, appWidgetManager, appWidgetIds);
final int N = appWidgetIds.length;
for (int i=0; i<N; i++) {
int appWidgetId = appWidgetIds[i];
Bundle options = appWidgetManager.getAppWidgetOptions(appWidgetId);
updateWidget(context, appWidgetManager, appWidgetId, options);
}
}
public void onAppWidgetOptionsChanged (Context context, AppWidgetManager
appWidgetManager, int appWidgetId, Bundle newOptions) {
updateWidget(context, appWidgetManager, appWidgetId, newOptions);
}
private void updateWidget(Context context, AppWidgetManager appWidgetManager,
int appWidgetId, Bundle options) {
// Do whatever you need to do to the widget. Include any customization based
// on the size, included in the options. Be sure to have a graceful fallback if
// no valid size data is included in the bundle.
}
...
}