Code example for FragmentStatePagerAdapter

Methods: getActivity

0
 
		@Override 
		public Fragment getItem(int position) {
			Bundle args = new Bundle();
			args.putInt("position", position);
			return Fragment.instantiate(getActivity(),
					MyFragment.class.getName(), args);
		} 
 
		@Override 
		public int getCount() { 
			return titles.length;
		} 
 
		@Override 
		public CharSequence getPageTitle(int position) {
			return titles[position];
		} 
	} 
 
}