Android 如何根据设备屏幕大小加载特定的xml布局文件?

Android 如何根据设备屏幕大小加载特定的xml布局文件?,android,android-screen-support,xml-layout,Android,Android Screen Support,Xml Layout,我已尝试使用此DevLoper上提供的这些说明 我需要在分辨率为1024x768的设备上加载res/layout-w1024dp-h768dp/activity_main.xml,或者加载默认的xml文件,因此我配置了AVD,我的项目浏览器如下所示 我已经尝试了所有,但它不工作的AVD的规格。。 谁能帮我一下吗 这是清单文件 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.

我已尝试使用此DevLoper上提供的这些说明

我需要在分辨率为1024x768的设备上加载
res/layout-w1024dp-h768dp/activity_main.xml
,或者加载默认的xml文件,因此我配置了AVD,我的项目浏览器如下所示

我已经尝试了所有,但它不工作的AVD的规格。。 谁能帮我一下吗

这是清单文件

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.fm_player"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="15" />

<supports-screens android:requiresSmallestWidthDp="768" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>

Android能否处理文件夹名称中的两种不同分辨率

您是否尝试过使用:

res/layout-sw768dp

从宽度和高度来看,哪一个长度最短,即768?

这是AndroidManifest文件的实际密度接下来,很明显,问题是:您是否确实使用了正确大小的设备?您是针对Android SDK>3.0版本进行编译的吗?