Code example for FragmentStatePagerAdapter

0
	} 
 
	private class ScreenSlidePagerAdapater extends FragmentStatePagerAdapter{ 
		 
		public ScreenSlidePagerAdapater(FragmentManager fm) {
			super(fm);
		} 
 
		@Override 
		public Fragment getItem(int position) {
			Log.e("position", Integer.toString(position));
			switch(position){
			case 0: 
				return new Screen1Fragment(); 
			case 1: 
				return new Screen2Fragment(); 
			default: 
				return null; 
			} 
		}