Code example for FragmentTransaction

Methods: commit, show

0
		FragmentManager fm = getSupportFragmentManager();
		FragmentTransaction ft = fm.beginTransaction();
		if (fw == null) {
			ft.show(fb);
		} else { 
			ft.show(fw);
		} 
 
		ft.commit();
	} 
 
	public void hide_Fragment(Black_Fragment fb, White_Fragment fw) {
		FragmentManager fm = getSupportFragmentManager();
		FragmentTransaction ft = fm.beginTransaction();
		if (fw == null) {
			ft.hide(fb);
		} else { 
			ft.hide(fw);
		} 
 
		ft.commit();