I need to update my AppWidget when my main activity pauses. I tried using the following code in my main activity's onPause():
super.onPause();
AppWidgetManager manager = AppWidgetManager.getInstance(this);
int[] a = manager.getAppWidgetIds(new ComponentName(this, "WidgetProvider"));
new WidgetProvider().onUpdate(this, manager, a);
When I call this code, however, a
is empty. What am I doing wrong?