Android display.setText(“@string/sport”);“为什么绳子不动呢?”;体育";展示?

Android display.setText(“@string/sport”);“为什么绳子不动呢?”;体育";展示?,android,string,Android,String,sport是Strings.xml中声明的字符串函数,但在应用程序中它没有显示? 有什么想法吗?试试: display.setText("@string/sport"); @resource/name引用仅在XML代码中有效。使用Java时,格式是R..谢谢Raghav,我是eclipse新手! display.setText(R.string.sport);

sport是Strings.xml中声明的字符串函数,但在应用程序中它没有显示? 有什么想法吗?

试试:

display.setText("@string/sport");

@resource/name
引用仅在XML代码中有效。使用Java时,格式是
R..

谢谢Raghav,我是eclipse新手!
display.setText(R.string.sport);