Android - Administrar diseños de paisaje
Necesito una actividad para cargar diferentes fragmentos según la orientación:
Actividad-> (retrato) Fragmento Retrato
Actividad-> (paisaje) Fragmento Paisaje
esto es activity_layout.xml
<LinearLayout 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"
tools:context="com.examples.MainActivity"
android:background="#FF0000">
<fragment
android:id="@+id/navigationContainerFragment"
android:name="com.examples.FragmentPort"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
esto es activity_layout_land.xml
<LinearLayout 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"
tools:context="com.examples.MainActivity"
android:background="#FF0000">
<fragment
android:id="@+id/navigationContainerFragment"
android:name="com.examples.FragmentLandscape"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
Entonces fragmentPortrait.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="FRAGMENT PORTRAIT"/>
</LinearLayout>
Y FragmentLanscape.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="FRAGMENT LANDSCAPE"/>
</LinearLayout>
Problema es que no veo FragmentLandscape al rotar. ¿Alguien me puede ayudar? Gracia
UPDATE: ya puse diferentes diseños en diferentes carpetas: / layout y / layout-land