Hallo Leute,
ich habe eine Activity die sich aus drei Fragmenten zusammensetzt.
Hier mal der Code von der Layoutdatei:
Code
		
					
			<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:orientation="vertical"
	android:layout_width="fill_parent"
	android:layout_height="fill_parent">
	<fragment
		class="de.fhluebeck.android.fragment.TabFragment"
		android:id="@+id/tab_fragment"
		android:layout_width="fill_parent"
		android:layout_height="wrap_content"/>
	
	<LinearLayout 
		android:orientation="horizontal"
		android:layout_width="fill_parent"
		android:layout_height="fill_parent">
	
		<fragment
			class="OSMapFragment"
			android:id="@+id/map_fragment"
			android:layout_width="fill_parent"
			android:layout_height="fill_parent"
			android:layout_weight="1"/>
				<fragment
			class="ConfigFragment"
			android:id="@+id/config_fragment"
			android:layout_width="fill_parent"
			android:layout_height="fill_parent"
			android:layout_weight="1"/>
			
	</LinearLayout>			
</LinearLayout>
	
			Alles anzeigen
	Im TabFragment habe ich ein Tabmenü erstellt, auch hierzu mal der Code:
Java
		
					
			import org.codeandmagic.android.R;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.TabHost.TabSpec;
import android.widget.TabHost.OnTabChangeListener;
public class TabFragment extends Fragment implements OnTabChangeListener {
	public static final String TAB_CONFIG = "config";
	public static final String TAB_AUTO = "auto";
	public static final String TAB_MANUAL = "manual";
	
	
	/** TabBar View */
	private View tabView;
	/** TabWarapper */
	private TabHost tabWrapper;
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		this.tabView 		= inflater.inflate(R.layout.tabs_fragment, null);
		this.tabWrapper	= (TabHost) tabView.findViewById(android.R.id.tabhost); 
		createTabElements();
		return tabView;
	}
	
	/** create tab elements */
	private void createTabElements() {
		tabWrapper.setup(); // important!
		tabWrapper.addTab(newTab(TAB_CONFIG, R.string.tab_config, R.id.tab_config));
		tabWrapper.addTab(newTab(TAB_AUTO, R.string.tab_auto, R.id.tab_auto));
		tabWrapper.addTab(newTab(TAB_MANUAL, R.string.tab_manual, R.id.tab_manual));
	}
	
	private TabSpec newTab(String tag, int labelId, int tabContentId) {
		View indicator = LayoutInflater.from(getActivity()).inflate(
				R.layout.tab, (ViewGroup) tabView.findViewById(android.R.id.tabs), false);
		((TextView) indicator.findViewById(R.id.text)).setText(labelId);
		TabSpec tabSpec = tabWrapper.newTabSpec(tag);
		tabSpec.setIndicator(indicator);
		tabSpec.setContent(tabContentId);
		
		
		return tabSpec;
	}
	public void onTabChanged(String tabName) {
	// was muss hier rein???
	}
}
	
			Alles anzeigen
	Wenn der Benutzer auf ein Tabelement klickt, also die Methode onTabChange aufgerufen wird, soll das Fragment ConfigFragment ersetzt werden mit einen anderen Fragment. Vielleicht könntet ihr mir ein Tip geben wie dies gehen könnte?!
Bzw. würde mir es schon reichen wenn Ihr mir sagen könnt, wie ich an die Instanz ConfigFragment heran komme?!
LG