开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜