Code example for FragmentStatePagerAdapter

Methods: instantiateItem

0
 
	//TODO: Add a gradient background from resources  
	//without sacrifying performance  
	@Override 
	public Object instantiateItem(ViewGroup arg0, int arg1) {
		return super.instantiateItem(arg0, arg1);
	} 
 
	private List<Fragment> fragments;
 
	public ComplexPagerViewAdapter(FragmentActivity activity,
			List<Fragment> fragments) {
		super(activity.getSupportFragmentManager());
		this.fragments = fragments;
	} 
 
	@Override 
	public Fragment getItem(int i) {
		return fragments.get(i);
	}