Code example for FragmentTransaction

Methods: attach, setCustomAnimations

0
				// If not, instantiate and add it to the activity 
				mFragment = Fragment.instantiate(mActivity, mClass.getName());
				ft.add(android.R.id.content, mFragment, mTag);
			} else { 
				// If it exists, simply attach it in order to show it 
				ft.setCustomAnimations(android.R.animator.fade_in,
						android.R.animator.fade_out);
				ft.attach(mFragment);
			} 
		} 
 
		public void onTabUnselected(Tab tab, FragmentTransaction ft) {
			if (mFragment != null) {
				ft.setCustomAnimations(android.R.animator.fade_in,
						android.R.animator.fade_out);
				ft.detach(mFragment);
			} 
		} 
 
		public void onTabReselected(Tab tab, FragmentTransaction ft) {
		}