title: One PagerAdapter for multiple fragments
body: <p>I have a basic PagerAdapter:</p>
  
  <pre><code>public class PagerAdapter extends FragmentStatePagerAdapter {
  int mNumOfTabs;
  
  private final List&lt;Fragment&gt; mFragmentList = new ArrayList&lt;&gt;();
  private final List&lt;String&gt; mFragmentTitleList = new ArrayList&lt;&gt;();
  
  public PagerAdapter(FragmentManager fm, int NumOfTabs) {
      super(fm);
      this.mNumOfTabs = NumOfTabs;
  }
  
  public void addFragment(Fragment fragment, String title) {
      mFragmentList.add(fragment);
      mFragmentTitleList.add(title);
  }
  
  public PagerAdapter(FragmentManager manager) {
      super(manager);
  }
  
  @Override
  public CharSequence getPageTitle(int position) {
      return mFragmentTitleList.get(position);
  }
  
  
  @Override
  public Fragment getItem(int position) {
  
      switch (position) {
          case 0:
              Main tab1 = new Main();
              return tab1;
          case 1:
              Secondary tab2 = new Secondary();
              return tab2;
          case 2:
              Third tab3 = new Third();
              return tab3;
          default:
              return null;
      }
  }
  
  @Override
  public int getCount() {
      return 3;
  }
  }
  </code></pre>
  
  <p>It works perfectly for one tablayout and 3 fragments which are displayed in the viewpager. I have multiple of the same fragment design (same tabs) across a few fragments. Is it possible to use this one PagerAdapter with multiple options (fragments), so all it has to change is the classes that are instantiated. 
        <code>Main tab1 = new Main();</code> to <code>SomeOtherClass tab1 = new SomeOtherClass();</code>. I tried doing this with parameters and variables but no success.</p>