定期的に更新したいウィジェットを備えたアプリに取り組んでいます。android:updatePeriodMillis="3600000" を設定しましたが、ListView が更新されません。私が見逃しているのは何ですか?
1334 次
1 に答える
2
onUpdate(...) 関数が呼び出されているかどうかを確認してください。更新期間後に onUpdate() が呼び出される場合はnotifyAppWidgetViewDataChanged()
、ListView のアダプターを呼び出す必要があります。それを更新するために。
AppWidgetManager mgr = AppWidgetManager.getInstance(context);
int[] ids = mgr.getAppWidgetIds(new ComponentName(context, AppWidgetProvider.class));
mgr.notifyAppWidgetViewDataChanged(yourWidgetId, R.id.list_view);
于 2013-01-23T20:25:26.840 に答える