Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

layout-xlarge being ignored using Nexus 10 emulator in Android Studio 1.4.1

I'm using Android Studio version 1.4.1.

I have the following 2 layout xmls in my layout-large dir:

activity-main.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:fitsSystemWindows="true"
    tools:context=".MainActivity">

    <android.support.design.widget.AppBarLayout android:layout_height="wrap_content"
        android:layout_width="match_parent" android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar android:id="@+id/toolbar"
            android:layout_width="match_parent" android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" />

    </android.support.design.widget.AppBarLayout>

    <include layout="@layout/content_main" />

    <android.support.design.widget.FloatingActionButton android:id="@+id/fab"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin"
        android:src="@android:drawable/ic_dialog_email" />

</android.support.design.widget.CoordinatorLayout>

content_main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:orientation="horizontal"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:showIn="@layout/activity_main" tools:context=".MainActivity">

    <fragment
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="2"
        class="com.hfad.workout.WorkoutListFragment"
        android:id="@+id/list_frag"/>

    <FrameLayout
        android:id="@+id/fragment_container"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="3" />
</LinearLayout>

Here is my AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.hfad.workout" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".DetailActivity"
            android:label="@string/title_activity_detail"
            android:theme="@style/AppTheme.NoActionBar" >
        </activity>
    </application>

</manifest>

Here is my build.gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.hfad.workout"
        minSdkVersion 17
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:design:23.1.0'
}

Here are the emulator details from Android Studio:

Name: Nexus_10_API_23

CPU/ABI: Google APIs Intel Atom (x86)

Path: /Users/rt/.android/avd/Nexus_10_API_23.avd

Target: Google APIs (API level 23)

Skin: nexus_10

SD Card: /Users/rt/.android/avd/Nexus_10_API_23.avd/sdcard.img

Snapshot: no

hw.lcd.density: 320

hw.dPad: no

hw.initialOrientation: landscape

avd.ini.encoding: UTF-8

hw.camera.back: none

disk.dataPartition.size: 200M

hw.gpu.enabled: yes

runtime.network.latency: none

skin.dynamic: yes

hw.keyboard: yes

runtime.network.speed: full

hw.device.hash2: MD5:47dc70fd92541dd16c19f9efa3e9db62

hw.ramSize: 1536

tag.id: google_apis

tag.display: Google APIs

hw.sdCard: yes

hw.device.manufacturer: Google

hw.mainKeys: no

hw.accelerometer: yes

hw.trackBall: no

hw.device.name: Nexus 10

hw.battery: yes

hw.sensors.proximity: no

AvdId: Nexus_10_API_23

hw.sensors.orientation: yes

hw.audioInput: yes

hw.camera.front: none

hw.gps: yes

avd.ini.displayname: Nexus 10 API 23

snapshot.present: no

vm.heapSize: 128

runtime.scalefactor: auto

When I run my app in the Nexus 10 emulator however, its using the layouts defined in the layout dir instead of the layout-xlarge dir. Any help is much appreciated!

like image 912
Rory Avatar asked Dec 25 '22 12:12

Rory


1 Answers

I fixed this by going into the AVD Manager > Edit this AVD > Show Advanced Settings > Custom skin definition

Change the skin from "nexus_10" to "No Skin"

like image 169
Rory Avatar answered Dec 27 '22 02:12

Rory