如何找到在appwidgetprovider视图id? [英] How to find view id in appwidgetprovider?

查看:372
本文介绍了如何找到在appwidgetprovider视图id?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个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直接修改意见。你应该在 RemoteViews

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

这篇关于如何找到在appwidgetprovider视图id?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆