Code example for FragmentStatePagerAdapter

Methods: setPrimaryItem

0
 
	@Override 
	public void setPrimaryItem(ViewGroup container, int position, Object object) {
		super.setPrimaryItem(container, position, object);
 
		if (cursor != null)
			mapControl.setTask(CursorConverters.getTask(position, cursor, c));
	} 
 
	@Override 
	public Fragment getItem(int position) {
		Fragment f = new TaskDetailsFragment();
		Bundle args = new Bundle();
		args.putSerializable(Std.TASK, CursorConverters.getTask(position, cursor, c));
		f.setArguments(args);
		return f;
	} 
 
	@Override 
	public CharSequence getPageTitle(int position) {
		return (position+1) +" "+ ofStr +" "+ getCount();