我正在开发一个应用程序,我收到了错误.我输入了一些String资源res/values/strings
并保存了它.现在如果我想在Activity中访问它,我会收到这样的错误
07-13 11:16:20.050: ERROR/AndroidRuntime(5883): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x7f060006
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚原因.资源看起来像这样:
<string name="dialog_download_text">please wait while downloading</string>
Run Code Online (Sandbox Code Playgroud)
我想像访问它一样
public void onCreate(Bundle b){
super.onCreate(b);
String s = getResources().getString(R.string.dialog_download_text);
}
Run Code Online (Sandbox Code Playgroud)
我也查看了R.java并找到了我的条目
public static final class string {
public static final int dialog_download_cancel=0x7f060005;
public static final int dialog_download_text=0x7f060007;
public static final int dialog_download_title=0x7f060006;
}
Run Code Online (Sandbox Code Playgroud)
我不知道该怎么做,因为我之前从未遇到过这样的问题.请帮我.谢谢大家.