It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center




已关闭8年。




我是android编程的新手,想知道这一点:

我在strings.xml文件中定义了3个字符串:
<resources> <string name="one">First Click </string> <string name="two">Second Click </string> <string name="three">Third Click </string> <resources>
和一个文本 View ,该 View 显示strings.xml文件中的第一个字符串。
我不想在用户使用settext("******")更改文本 View 的文本时
单击一个按钮。
我怎样才能使textview切换到strings.xml文件中已经定义的文本,例如从

最佳答案

使用setText(getResources().getString(R.string.one));

10-07 18:17