I have two fragments in an activity:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:id="@+id/mainlayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<fragment
class="com.eyecreate.fragment1"
android:id="@+id/fragment1"
android:layout_height="match_parent"
android:layout_width="269dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true" />
<fragment
android:id="@+id/fragment2"
android:layout_toRightOf="@id/fragment1"
android:layout_alignTop="@id/fragment1"
android:layout_alignBottom="@id/fragment1"
android:layout_alignParentRight="true"
class="com.eyecreate.fragment2"
android:layout_height="match_parent"
android:layout_width="match_parent"></fragment>
</RelativeLayout>
fragment1 doesn’t show up on screen and isn’t on the Hierarchy Viewer, but has an instance in code that still has calls to onCreate run on it. fragment2 shows up and takes up the whole screen. What could be causing it to have just disappeared?
Feeling kinda dumb, I had a call to
getActivity().setContentView(fragment2)
during the onresume of that fragment. That would be causing the fragment2 to be the only one showing up.