Code example for FragmentTransaction

Methods: commit, hide

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