Code example for FragmentTransaction

Methods: commit, replace

0
		Log.d(TAG, "Showing fragment " + fragment.toString());
 
		// no animation 
//		ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN); 
 
		ft.replace(FRAG_CONTAINER_ID, fragment);
 
		// try not adding to back stack 
//		ft.addToBackStack(null); 
		ft.commit();
	} 
 
	public void showPage(Page page) {
		if(mPage != null) mPage.cleanupActionBar(mActivity.actionBar());
		 
		Log.d(TAG, "Showing page " + page.toString());
		 
		page.setupActionBar(mActivity.actionBar());
		showFragment(page.getVisibleFragment());
		 
		mPage = page;