I have created an AppWidget for Honeycomb which is working well, except that when first installed, it does not show up in the Widgets menu so it can not be added to a home s
To solve this problem with my widget I send widget update broadcast, like this in my WidgetController.class:
Intent intent = new Intent();
intent.setClassName(context, context.getPackageName() + ".WidgetProvider");
intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS,
getWidgetIds(context));
context.sendBroadcast(intent);
then to provide stable widget initialization in the system I send this broadcast from Application object when application or widget start:
public class MyApp extends Application {
@Override
public void onCreate() {
WidgetController.getInstance().updateWidget(getApplicationContext());
}
}
!!! Important: when AppWidget hosts in application it's enough, but when AppWidget separated from it you should use way proposed by @John above in this topic.