java - 无法从布局文件夹引用布局

标签 java android xml android-layout

我在布局文件夹中有一个名为“activity_qrtest”的布局。当我尝试在类中引用此布局时,如下所示:

setContentView(R.layout.activity_qrtest);

eclipse 用红色突出显示布局名称“activity_qrtest”,这意味着它不可用。

控制台输出:

[2012-09-10 17:15:15 - QRTest] ERROR: resource directory 'D:\workspaceQR\QRTest\res'  
does not exist 
[2012-09-10 17:26:48 - QRTest] 'default' is not a best match for any device/locale  
combination.
[2012-09-10 17:26:48 - QRTest] Displaying it with 'Locale Language ___Region __,  
sw320dp, w320dp, h533dp, Normal Screen, Long screen aspect ratio, Portrait   
Orientation, High Density, Finger-based touchscreen, Soft keyboard, No keyboard,  
Exposed navigation, Trackball navigation, Screen resolution 800x480, API Level 16'   
which is compatible, but will actually be displayed with another more specific   
version of the layout.
[2012-09-10 17:28:41 - QRTest] AndroidManifest.xml file missing!

解决此类问题的任何建议。

最佳答案

在控制台 View 中检查 activity_qrtest.xml 文件中是否存在任何错误。很可能你的 xml 不正确。另外,尝试Project|Clean

关于java - 无法从布局文件夹引用布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12355079/

相关文章:

java - 在不使用数组和特殊方法的情况下,如何制作 nthWord 方法?

java - 通过Spring使用@Requestmapping的.jsp页面POST表单不起作用

java - 咄咄逼人和西类牙人搞乱了布局

android - 转换结果 findViewById android 方法

java - 如何阅读此消息或使用什么类型的编码来创建此消息?

xml - 省略额外的 xlmns 和 xmlns :tei that appear when I apply my transformation

ios - 使用 magento SOAP API 的 multicall 方法的正确方法是什么?

java - 无法使用 Java 连接到 Hbase

java - 如何录制音频,以使其在达到特定长度后覆盖录制的开始?

android - 如何在Android中运行依赖于库的项目