Reusing Fragment and layout.xml for Android Tabs Action Bar
===

I am programming my first Android App and am facing a problem :( I am using Eclipse and the app is intended to run from Android 4.0.3.

I have a tab actionbar on the top of the view, constisting of 4 tabs. Three of them have the same structure:  a radiogroup with two radiobuttons and a listView under it. These tabs are based on the same data and will be used to filter the data. The text of the radioButton depends on the tab and will further filter the data. 

The last tab has a completely different layout and function.

I have made two fragment and two layouts (one for the first three, and one for the last tab). The first fragment is managing the radiogroup an the listview. I also have an adapter to set the data model, depending on which tab and button is selected. But somehow I just can't get it to work correctly. The of the radiobuttons doesn't refresh and the list is only showing first time the activity is loaded. No exception is thrown.

Is my approach wrong?

Here is the my main activity:


    	@Override
	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.list_main);

		appContext = getApplicationContext();


		dataholder = (P1DataHolder) getIntent().getSerializableExtra(
				"data"); //Hold all the data

		final ActionBar mainBar = getActionBar();
		mainBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
		mainBar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE);

		// create the fragments with the name of parent tab
		Fragment aFragment = new ListFragment(
				MyApplication.TAB_A);
		Fragment bFragment = new ListFragment(
				MyApplication.TAB_B);
		Fragment cFragment = new ListFragment(
				MyApplication.TAB_C);
		Fragment settingFragment = new P1SettingFragment();

		// Fragment A
		ActionBar.Tab tabA = mainBar.newTab().setText(
				MyApplication.TAB_A);
		tabA.setTabListener(new TabsListener(aFragment));

		// Fragment B
		ActionBar.Tab tabB = mainBar.newTab().setText(
				MyApplication.TAB_B);
		tabB.setTabListener(new TabsListener(bFragment));

		// Fragment C
		ActionBar.Tab tabC = mainBar.newTab().setText(
				MyApplication.TAB_C);
		tabC.setTabListener(new TabsListener(cFragment));

		// Settings
		ActionBar.Tab tabSetting = mainBar.newTab().setText(
				MyApplication.TAB_SETTING);
		tabSetting.setTabListener(new TabsListener(settingFragment));

		// Adding Tabs to actionbar
		mainBar.addTab(tabA);
		mainBar.addTab(tabB);
		mainBar.addTab(tabC);
		mainBar.addTab(tabSetting);

	}

Thank you in advance and I am hoping for some tips ;)

Diana
