Skip to content Skip to sidebar Skip to footer

Android Is Not Choosing The Correct Layout File

I have 3 different layout files layout/ main.xml layout-large/ main.xml layout-sw600dp/ main.xml My nexus 7 is always using the layout/main.xml Is there something I ha

Solution 1:

The docs didn't mention it but you have to have the supports-screens set up right in AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.gpsinsight.gpsandroid"                                                             
      android:versionCode="1"
      android:versionName="1.0">
    <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"        android:largeScreens="true"
        android:xlargeScreens="true" />
    <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
        <activity android:name="MainActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

Post a Comment for "Android Is Not Choosing The Correct Layout File"