progress bar in appwidget for a playback service

五迷三道 提交于 2019-12-11 15:59:50

问题


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.



来源:https://stackoverflow.com/questions/4946814/progress-bar-in-appwidget-for-a-playback-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!