开发者

Updating widget on day change

What's the best way to call onUpdate on a widget once a day, after the date changes? It's no开发者_Go百科t high priority so it can wait until the phone wakes.


Just set an alarm with an Intent that your AppWidgetProvider receives using the AlarmManager.

If you want the alarm to be fired only if the device is awake you should use ELAPSED_REALTIME or RTC as the alarm type. Make sure your xml file has updatePeriodMillis set to 0.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜