开发者

How do I add a View (dynamically) in an android widget? (API-level 3)

开发者 https://www.devze.com 2022-12-25 05:07 出处:网络
How do I add a View dynamically in an android widget? I realize that the RemoteViews works as a container of updates, but the RemoteViews.addView is only available on API level 7 (and I want my widge

How do I add a View dynamically in an android widget?

I realize that the RemoteViews works as a container of updates, but the RemoteViews.addView is only available on API level 7 (and I want my widget to work on HTC Hero phones, which has API level开发者_Python百科 3).


In your AppWidgetProvider, when you create your RemoteViews instance to do an update, you pass in a layout ID to the constructor. If you want your app widget to have different contents, pass in a different layout ID.

0

精彩评论

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