0

My view comes up with the default portrait view. When I use CTRL+F12 in the Eclipse simulator it does not rotate.

I am using Nexus_API_17.

I created the layout view under layout-land.

http://screencast.com/t/050JYDLXuN7c

Here is the code for layout-land - activity-quiz.xml. What am I doing wrong:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <TextView
        android:id="@+id/question_text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:padding = "24dp"/>



    <LinearLayout 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_gravity="center_vertical|center_horizontal">

        <Button
        android:id="@+id/true_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/true_button" />

        <Button
        android:id="@+id/false_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/false_button" />

    </LinearLayout>    

   <LinearLayout 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_gravity="center_vertical|center_horizontal">
    <ImageButton
        android:contentDescription="@string/MyImage1"
        android:id="@+id/prev_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/arrow_left"
        android:layout_gravity="bottom|left"
        />
    <ImageButton
        android:contentDescription="@string/MyImage2"
        android:id="@+id/next_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/arrow_right"
        android:layout_gravity="bottom|right"
        />


    </LinearLayout>

</FrameLayout>
user3618129
  • 85
  • 1
  • 1
  • 7
  • As far as I know, the **only** emulator that works properly in both orientations is **API Level 2.2**. I've always had problems with all newer ones (but maybe it's because I'm using the `Eclipse ADT Bundle`?). – Phantômaxx Sep 18 '14 at 07:17
  • 1
    Thanks Frank. So the only way is to test with a physical device? – user3618129 Sep 18 '14 at 17:20
  • No. Another way is to make your app compatible with a minor minSdkVersion (use **8**). **BUT!** You might have to make so many modifications, like adding the **support library** and using the support methods... maybe, the **best** way (to not let you faint) is to USB-debug your app with a physical device. – Phantômaxx Sep 18 '14 at 17:23
  • 1
    Thanks again Frank. I will chose the USB debug method. – user3618129 Sep 18 '14 at 17:40
  • It's the straightest and fastest way you can travel. Even if... Nexet time you develop an app, consider supporting older devices as well... Froyo still has the **0.7% of the global market**, which is **about 14 millions** potential customers. – Phantômaxx Sep 18 '14 at 17:43
  • 1
    oh. Froyo wasn't even in my mind. May be I will take the harder route and get it done right. Thanks again for the time. – user3618129 Sep 18 '14 at 18:13

1 Answers1

0

Thanks Frank N.Stein for suggesting the right way to do it through comments:

For anyone with this issue, this is how I set up old Froyo AVD to test this scenario:

  1. My Manifest min version is already 8, which is Froyo

    < uses-sdk android:minSdkVersion="8" android:targetSdkVersion="21" />

  2. You can see SDK_API_VERSION information here. http://developer.android.com/guide/topics/manifest/uses-sdk-element.html

  3. In the SDK manager Installed the needed version:

http://screencast.com/t/KKZokotI4T

  1. Created a new AVD for the new version.

http://screencast.com/t/W8VN6fOWGW

user3618129
  • 85
  • 1
  • 1
  • 7