Code example for FragmentStatePagerAdapter

Methods: setPrimaryItem

0
	@Override 
	public abstract Fragment getItem(int position);
	 
	@Override 
	public void setPrimaryItem(ViewGroup container, int position, Object object) {
		super.setPrimaryItem(container, position, object);
	} 
 
	@Override 
	public int getCount() { 
		if (stories != null && stories.getCount() > 0) {
			return stories.getCount();
		} else { 
			return 1; 
		} 
	} 
 
	public Story getStory(int position) {
		if (stories == null || position >= stories.getCount()) {
			return null;