Beispiel #1
0
 public static EventFragment newInstance(int sectionNumber) {
   EventFragment fragment = new EventFragment();
   Bundle args = new Bundle();
   args.putInt(ARG_SECTION_NUMBER, sectionNumber);
   fragment.setArguments(args);
   return fragment;
 }
Beispiel #2
0
    @Override
    public Fragment getItem(int position) {
      // getItem is called to instantiate the fragment for the given page.
      // Return a PlaceholderFragment (defined as a static inner class below).
      // return PlaceholderFragment.newInstance(position + 1);

      // This method needs to be changed to return the 3 different fragment types
      // for each type - if position = 0, list, = 1, QR, = 2, other list.

      // To change the type/number of tabs, change this
      switch (position) {
        case 0:
          return ProductListFragment.newInstance(position + 1);
        case 1:
          return QRFragment.newInstance(position + 1);
        case 2:
          return EventFragment.newInstance(position + 1);
        default:
          return PlaceholderFragment.newInstance(position + 1);
      }
    }