In Eclipse-Android; I created two xml files; one for portrait and one for landscape. In a tutorial, the instructor simply added the same xml portrait content to a landscape xml file and when the application ran the view was correctly displayed in both portrait and landscape modes. However, I tried doing the same thing with a list view but the list view does not rotate to landscape. I have set the orientation to horizontal with android:orientation="horizontal" and in the graphical layout I can see the content in landscape, but when the application runs the portrait list view content does not rotate to landscape. What could I be doing wrong?
Here is the xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
tools:context=".Activity" >
<TextView
android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="@string/no_data" /> <!-- Will display when There is no data. Need to Add Name/Value to xml value string.xml file as well -->
<ListView
android:id="@android:id/list"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:orientation="horizontal" >
</ListView>