【发布时间】:2012-09-10 15:44:48
【问题描述】:
我在布局文件夹中有一个名为“activity_qrtest”的布局。当我尝试在类中引用此布局时,如下所示:
setContentView(R.layout.activity_qrtest);
eclipse 用红色突出显示布局名称“activity_qrtest”,表示它不可用。
cosole 输出:
[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!
任何解决此类问题的建议。
【问题讨论】:
-
检查您是否包含正确的“R”类。您可能会不小心包含“android.R”而不是您的项目生成的 R 类
-
我尝试了你的建议,但不幸的是没有解决问题
-
你的项目中有 AndroidManifest.xml 文件吗?请发布activity_qrtest.xml的完整路径
-
是的,我有清单文件,但是如何发布 activity_qrtest.xml 的完整文件?我在 res 文件夹中有 res 文件夹,有 layout 文件夹,在 layout 文件夹中有 activity_qrtest.xml
-
“res”文件夹中是否有任何带有“-default”后缀的文件夹?您能否将“res”文件夹中所有文件夹的名称粘贴到此处?
标签: java android xml android-layout