コード例 #1
0
ファイル: MainActivity.java プロジェクト: jpw234/JFSKC
    @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);
      }
    }