Code example for FragmentManager

Methods: getBackStackEntryCount

0
	} 
 
	@Override 
	public void clearFragments() { 
		FragmentManager fm = getSupportFragmentManager();
		for(int i = 0; i < fm.getBackStackEntryCount(); i ++)    
			fm.popBackStack();
	} 
 
	@Override 
	public void setMenuFragment(Fragment f) {
		FragmentManager fm = getSupportFragmentManager();
		FragmentTransaction ft = fm.beginTransaction();
		ft.replace(R.id.menu_frame, f);
		ft.commit();
 
		wMenuFragment = new WeakReference<Fragment>(f);
	} 
 
	@Override 
	public Fragment getMenuFragment() {