XML (works):android:text="@android:string/cancel"R.string.some_string_that_I_have_added_to_strings_xmlJava (不工作:找不到符号变量cancel/ok):R.string.ok
…即使它们在的示例中使
因此,我正在尝试调试我的应用程序,并使用以下代码行计算表达式: resources.getString(R.string.my_string); 我应该从strings.xml获取我的字符串,但是我得到一个错误: Method threw 'android.content.res.Resources$NotFoundException' exception.有人知道为什么我不能在评估时处理资源吗? here you can see what I'm talking about