include タグを使用して、横向きモードで activity_main.xml と contact_details.xml のレイアウト コードを再利用しようとしました。activity_main を左側に、contact_details を右側に表示したいと思います。しかし、横向きモードに切り替えるとアプリケーションがクラッシュします。
これは activity_main.xml のコーディングです
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/list_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<Button
android:id="@+id/btnAddContact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="0"
android:text="Add Contact" />
</LinearLayout>
これは、contact_details.xml のコーディングです。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/lvContactDetails"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
これは私のlayout-land/activity_main.xmlのコーディングです
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<include layout="@layout/activity_main"/>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#A3A3A3"/>
<include layout="@layout/contact_details"/>
</LinearLayout>
この問題を解決するためのヒントはありますか? 前もって感謝します。