I developed RelativeLayout. I am trying to add a fragment to it. It is overlapping. What I need to do to get it below the others.
FragmentTransaction t = getSupportFragmentManager().beginTransaction(); FragmentTest myFragment = new FragmentTest(); t.add(layout.getId(), myFragment, "myFirstFragment"); FragmentTest myFragment2 = new FragmentTest(); t.add(layout.getId(), myFragment2, "mySecondFragment"); t.commit();
// Overlay views myFragment and myFragment2, although I set the orientation to vertical.
<RelativeLayout android:id="@+id/idll1" android:layout_width="fill_parent" android:layout_height="50dp" android:layout_marginLeft="10sp" android:layout_marginRight="0sp" android:layout_marginTop="10sp" android:layout_weight="1" android:paddingBottom="5dp" android:paddingLeft="10dp" android:paddingRight="5dp" android:paddingTop="5dp" android:orientation="vertical"/>
android android-layout android-fragments relativelayout
Satish
source share