メインアクティビティが一時停止したときにAppWidgetを更新する必要があります。メインアクティビティのonPause()で次のコードを使用してみました。
super.onPause();
AppWidgetManager manager = AppWidgetManager.getInstance(this);
int[] a = manager.getAppWidgetIds(new ComponentName(this, "WidgetProvider"));
new WidgetProvider().onUpdate(this, manager, a);
ただし、このコードを呼び出すと、a
空になります。私は何が間違っているのですか?