public static ContactsFragment getInstance(int position) { ContactsFragment myFragment2 = new ContactsFragment(); Bundle args = new Bundle(); args.putInt("position", position); myFragment2.setArguments(args); return myFragment2; }
@Override public Fragment getItem(int position) { Fragment myFragment = null; switch (position) { case CONTENT: myFragment = ContentFragment.getInstance(position); break; case VIEW: myFragment = ViewFragment.getInstance(position); break; case CONTACTS: myFragment = ContactsFragment.getInstance(position); break; } return myFragment; }