I wanted to display a progress bar in an appwidget that displays playback progress from a background service. I know the appwidget supports that control, but I am wondering how I might go about updating the progress bar in a way that is consistent with good widget design (e.g. low battery consumption). The way I would normally do it in an activity would be by polling the playback on a timer. I haven't implemented this yet, so I am not even sure if it would work in an appwidget. Anyone know better than me?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Have the service update the app widget's RemoteViews
when sufficient time has elapsed to make it worthwhile to update.