问题描述
我有一个appwidget从appwidgetprovider延伸。
I have a appwidget extends from appwidgetprovider.
我创建了一个名为main_layout.xml布局XML文件,并添加一个按钮。如果我开发一个listActivity我达到这个按钮,这条路径:R.layout.main_layout.button01。
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)
活动类有一个名为findViewById(),但appwidgetprovider还没有一个成员方法。
Activity class has a member method that named findViewById() but appwidgetprovider has not.
我怎样才能达到我的按钮,在我的布局?
How can i reach my button in my layout?
对不起,我的英语
推荐答案
您不能引用或Appwidget直接修改意见。你应该在。
You can never reference or modify views in Appwidget directly. You should do this in RemoteViews.
这篇关于如何找到在appwidgetprovider视图id?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!