I have designed the perfect portrait layout. I'd like to include is as a part of the landscape version (see attachment).
There is no extra functionality, so I don't see a need to go to trouble of using Fragments.
Of course, one cannot include the portrait version of a layout in the landscape version. The following code produces the obvious error of "layouts should not include itself":
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<include
android:layout_width="wrap_content"
android:layout_height="match_parent"
layout="@layout/my_perfect_layout"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/demo"
/>
</LinearLayout>
Is there a way to force a layout directory so that I don't get this include infinite loop? Or is there another way altogether? I'd really like to avoid changing any java code at this point!
Best practice: