I’m building application with actionbar.Tab with 4 fragments.
I want to replace one of the list-fragments with other fragments by clicking on the first item of the listView inside that listFragment.
The xml contains only image and the list view:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:id="@+id/joFl"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/jo_logo" />
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@android:color/black"
android:clickable="true"
android:paddingTop="10dp"
android:smoothScrollbar="true" >
</ListView>
</LinearLayout>
and the code is:
{
case 0: {
FragmentTransaction ft = getFragmentManager().beginTransaction();
ShultzFragment sf = new ShultzFragment();
ft.replace(R.id.joFl, sf);
ft.commit();
break;
}
I’ve also tried to change from LinearLayout to FrameLayout but it doesn’t show the imageView and the replace() works but it show the 2 fragments together.
Is there a simplier way to implement that?
thanks in advance, udi
Solved this issue by:
thanks anyway