如何使用FindViewById更新文本视图
我正在尝试使用FindViewById()更新文本视图,但是在我的otreate中,我正在调用一个布局,该布局不包括我要更新的文本视图 - 它们是单独的文件。
我已经阅读了FindViewById()的Android开发人员文档,但是我还没有找到如何找到不在相同爆发布局的ID(这意味着我无法使用r.id.callable_textview)。
如何使FindViewById()在未在ongreate上调用的单独布局中找到文本视图?
I am trying to update a TextView by using findViewByID(), but in my onCreate I am calling a layout which does not include the TextView I want to update-they are seperate files.
I have read through the Android Developer Documentation for findViewByID() but I have not found how to find an ID that is not in the same onCreate layout (which means I cannot use R.id.callable_textview).
How can you make findViewById() find the TextView in a seperate layout not called on the onCreate?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于
活动
a至活动
b的信息,您可以使用 internextent Extras /a>。如果您需要从活动
b回到活动
a,则可以使用 startActivityForresult()。您不应该尝试从另一个
活动
的视图
s active> activity 。那不是它的工作方式。For passing information from
Activity
A toActivity
B, you can use Intent extras. If you need to pass information fromActivity
B back toActivity
A, you can use startActivityForResult().You shouldn't be trying to access the
View
s of oneActivity
from anotherActivity
. That's not how it works.