The Android tablet in the emulator does not select the correct layout

I'm new to Android and trying to learn how to use multiple layout folders to specify different layouts for devices of different sizes.

I tried several different things, but nothing works to force my emulated tablet to use a larger layout.

My layout directory structure:

  • location
  • large layout
  • layout sw600dp
  • XLarge layout

main.xml in layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
        >
    <SearchView android:id="@+id/searchView"
                android:iconifiedByDefault="false"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>

    <FrameLayout
            android:id="@+id/EarthquakeFragmentContainer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />
</LinearLayout>

In the following three folders main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:orientation="horizontal">

    <SearchView android:id="@+id/searchView"
                android:iconifiedByDefault="false"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="#FFF"/>

    <fragment android:name="com.paad.earthquake.EarthquakeListFragment"
              android:id="@+id/EarthquakeListFragment"
              android:layout_width="360dp"
              android:layout_height="fill_parent"
            />

    <fragment android:name="com.paad.earthquake.EarthquakeMapFragment"
              android:id="@+id/EarthquakeMapFragment"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
            />

</LinearLayout>

Emulator setup is trying to imitate the Google Nexus 7:

  • Target: Google API (API level 16)
  • Leather: WXGA800-7in
  • SD Card: 16M
  • I use all the other parameters that come with the skin, plus hw.keyboard = yes and hw.ramSize = 512

Does anyone know why this is not working?

Thank you for your help!

+5
1

10- Android 3.2 , layout-sw720dp,

0

All Articles