title: Dynamically adding/removing pages from FragmentStatePagerAdapter
body: <p>I was looking at the example of the FragmentStatePagerAdapter at <a href="http://developer.android.com/reference/android/support/v4/app/FragmentStatePagerAdapter.html" rel="nofollow">http://developer.android.com/reference/android/support/v4/app/FragmentStatePagerAdapter.html</a></p>
  
  <pre><code>public static class MyAdapter extends FragmentStatePagerAdapter {
      public MyAdapter(FragmentManager fm) {
          super(fm);
      }
  
      @Override
      public int getCount() {
          return NUM_ITEMS;
      }
  
      @Override
      public Fragment getItem(int position) {
          return ArrayListFragment.newInstance(position);
      }
  }
  </code></pre>
  
  <p>I've also looked around at other posts in stackoverflow, but I am still unsure as to how to add/remove pages from the fragmentStatePagerAdapter, and also how exactly the getItem method is called. So if I were looking to add a method to MyAdapter to add pages, how would that be done? Or is that not the standard way of adding pages? Any information is appreciated.</p>