title: FragmentPagerAdapter cannot be insantiated but it is NOT abstract
body: <pre><code>final PagerAdapter adapter = new FragmentPagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount());
  </code></pre>
  
  <p>I'm getting an error that says FragmentPagerAdapter is abstract; cannot be instantiated... except that my FragmentPagerAdapter is not abstract.</p>
  
  <p>Here is the adapter:</p>
  
  <pre><code>public class FragmentPagerAdapter extends FragmentStatePagerAdapter {
      int mNumOfTabs;
  
      public FragmentPagerAdapter(FragmentManager fm, int NumOfTabs) {
          super(fm);
          this.mNumOfTabs = NumOfTabs;
      }
  
      @Override
      public Fragment getItem(int position) {
  
          switch (position) {
              case 0:
                  TabFragment1 tab1 = new TabFragment1();
                  return tab1;
              case 1:
                  TabFragment2 tab2 = new TabFragment2();
                  return tab2;
              default:
                  return null;
          }
      }
  
      @Override
      public int getCount() {
          return mNumOfTabs;
      }
  }
  </code></pre>
  
  <p>It also says the class here is never used, but IT IS. This is the method I use in my MainActivity onCreate:</p>
  
  <pre><code>public FragmentManager getFragmentManager() {
      TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
      tabLayout.addTab(tabLayout.newTab().setIcon(R.drawable.ic_menu_sun));
      tabLayout.addTab(tabLayout.newTab().setIcon(R.drawable.ic_menu_calendar));
      tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
  
      final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
      final PagerAdapter adapter = new FragmentPagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount());
      viewPager.setAdapter(adapter);
      viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
      tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
          @Override
          public void onTabSelected(TabLayout.Tab tab) {
              viewPager.setCurrentItem(tab.getPosition());
          }
  
          @Override
          public void onTabUnselected(TabLayout.Tab tab) {
  
          }
  
          @Override
          public void onTabReselected(TabLayout.Tab tab) {
  
          }
  
      });
  
      viewPager.getAdapter().notifyDataSetChanged();
  
      Bundle bundle = getIntent().getExtras();
      if (bundle != null) {
          if (bundle.getString("fragment") != null) {
              if ("fragment2".equals(bundle.getString("fragment"))) {
              /*Log.w(getClass().toString(), bundle.getString("fragment"));*/
                  viewPager.setCurrentItem(1);
              } else {
                  viewPager.setCurrentItem(0);
              }
          }
      }
  
      return null;
  }
  </code></pre>
  
  <p>What the heck is going on!?</p>