title: Android Wear: WearableActivity with FragmentPagerAdapter
body: <p>When using the WearableActivity you can't reach <code>getSupportFragmentManager()</code> which <code>FragmentPagerAdapter</code> requires, so you need to use <code>getFragmentManager()</code>.</p>
  
  <h3>Activity</h3>
  
  <pre><code>public MyWearActivity extends WearableActivity {
  
      public ArrayList&lt;Fragment&gt; mFragments;
      public ArrayList&lt;String&gt; mTitles;
      public ViewPager mViewPager;
      public PageFragmentPagerAdapter mPagerAdapter;
  
      @Override
      public void onCreate(Bundle b) {
          super.onCreate(b);
          setContentView(R.layout.main);
          fragments = new ArrayList&lt;&gt;();
          mTitles = new ArrayList&lt;&gt;();
          mViewPager = (ViewPager) findViewById(R.id.viewpager);
  </code></pre>
  
  <p>
  
  <pre><code>        mPagerAdapter = new PageFragmentPagerAdapter(getFragmentManager()); &lt;-- PROBLEM
  </code></pre>
  
  <p>
  
  <pre><code>        // More code
      }
  }
  </code></pre>
  
  <h3>Pager adapter</h3>
  
  <pre><code>public class PageFragmentPagerAdapter extends FragmentPagerAdapter {
  
      public PageFragmentPagerAdapter(FragmentManager fm) {
  </code></pre>
  
  <p>
  
  <pre><code>        super(fm); &lt;-- PROBLEM
  </code></pre>
  
  <p>
  
  <pre><code>    }
  
      @Override
      public int getCount() {
          return mFragments.size();
      }
  
      @Override
      public PageFragment getItem(int position) {
          return mFragments.get(position);
      }
  
      @Override
      public CharSequence getPageTitle(int position) {
          return mTitles.get(position);
      }
  }
  </code></pre>
  
  <p>What can I do to use a <code>FragmentPagerAdapter</code> inside a <code>WearableActivity</code>?</p>