开发者

what can the updateAppWidget function do?

开发者 https://www.devze.com 2023-02-25 11:03 出处:网络
In the Widget project ,I call the updateAppWidget function.Then the widget project is updated. I want to kown how can the widget project is up开发者_如何学编程dated?

In the Widget project ,I call the updateAppWidget function.Then the widget project is updated. I want to kown how can the widget project is up开发者_如何学编程dated? The onReseive() function is called? Thanks!


When you call updateAppWidget you are setting a widget ID and RemoteViews. RemoteViews is a content of your widget. You can inflate it from resources, set text to items, add on click listenters (not regular ones, but trough PendingIntent's), etc...

Then AppWidgetManager draws/updates your widget using its ID and supplied RemoteViews

onReceive is called in another cases, i.e. then some broadcast intent is sent from a click on widget's button or any other event.

0

精彩评论

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