I have been at this for about 3 days looking up various websites for reference, but I am stuck. I am using the swipe and tabs layout which give you the standard dummy sectio
Use the method this way:
@Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a DummySectionFragment (defined as a static inner class
// below) with the page number as its lone argument.
switch (position) {
case 0:
Fragment fragment = new DummySectionFragment();
Bundle args = new Bundle();
args.putInt(fragment.ARG_SECTION_NUMBER, position + 1);
fragment.setArguments(args);
return fragment;
case 1:
Fragment fragment2 = new DummySectionFragment2();
Bundle args = new Bundle();
args.putInt(fragment2 .ARG_SECTION_NUMBER, position + 2);
fragment2.setArguments(args);
return fragment2;
case 2:
Fragment fragment3 = new DummySectionFragment3();
Bundle args = new Bundle();
args.putInt(fragment3.ARG_SECTION_NUMBER, position + 3);
fragment3.setArguments(args);
return fragment3;
default:
return null;
}
}