How to find view id in appwidgetprovider?

蓝咒 提交于 2019-12-01 17:34:27

问题


I have a appwidget extends from appwidgetprovider.

I have created a layout xml file named main_layout.xml and add a button. If i develop a listActivity i reach this button with this path: R.layout.main_layout.button01.

(Button)findViewById(R.layout.main_layout.button01)

Activity class has a member method that named findViewById() but appwidgetprovider has not.

How can i reach my button in my layout?

sorry for my english


回答1:


You can never reference or modify views in Appwidget directly. You should do this in RemoteViews.



来源:https://stackoverflow.com/questions/4666687/how-to-find-view-id-in-appwidgetprovider

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