packageorg.marcinzelent.liberavem;importandroid.content.Context;importandroid.support.v4.app.Fragment;importandroid.support.v4.app.FragmentManager;importandroid.support.v4.app.FragmentPagerAdapter;publicclassViewPagerAdapterextendsFragmentPagerAdapter{privateContextmContext;publicViewPagerAdapter(Contextcontext,FragmentManagerfm){super(fm);mContext=context;}// This determines the fragment for each tab@OverridepublicFragmentgetItem(intposition){if(position==0){returnnewMyObservationsFragment();}else{returnnewAllObservationsFragment();}}// This determines the number of tabs@OverridepublicintgetCount(){return2;}// This determines the title for each tab@OverridepublicCharSequencegetPageTitle(intposition){// Generate title based on item positionswitch(position){case0:returnmContext.getString(R.string.my_observations);case1:returnmContext.getString(R.string.all_observations);default:returnnull;}}}