什么意思。没有看明白你问的。首先 你在strings.xml文件里写上你要显示的内容:如:
android系统后自动在R.java中生成一个引用
public static final class string {
public static final int hello=0x7f040000;
}
这个不用程序员实现。
然后在你代码中需要使用时只需要调用R.string.hello即可.如textView.setText(R.string.hello)。
首先 你在strings.xml文件里写上你要显示的内容:
如:
Hello World, MainActivity!
android系统后自动在R.java中生成一个引用
public static final class string
{
public static final int hello=0x7f040000;
}
这个不用程序员实现。
然后在你代码中需要使用时只需要调用R.string.hello即可.
textView.setText(R.string.hello)。
context.getResources().getString(int id)或者getString(int id,Object ...obj)