title: Looping a FragmentPagerAdapter
body: <p>I have a <code>FragmentPagerAdapter</code> that works as it should but what I am wondering is that if the <code>FragmentPagerAdapter</code> is on the last view how can I have it loop back to the first view and continue on like normal</p>
  
  <p>this is my example code that I am using</p>
  
  <pre><code>public class FragmentPager extends FragmentActivity {
  MyAdapter mAdapter;
  ViewPager mPager;
  static final int NUM_ITEMS = 5;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      mAdapter = new MyAdapter(getSupportFragmentManager());
  
      mPager = (ViewPager)findViewById(R.id.pager);
      mPager.setAdapter(mAdapter);
  }
  
  public static class MyAdapter extends FragmentPagerAdapter {
      public MyAdapter(FragmentManager fm) {
          super(fm);
      }
  
      @Override
      public int getCount() {
          return NUM_ITEMS;
      }
  
      @Override
      public Fragment getItem(int position) {
          return MyFragment.newInstance(position);
      }
  }
  
  public static class MyFragment extends ListFragment{
      int mNum;
  
      /**
       * Create a new instance of CountingFragment, providing "num"
       * as an argument.
       */
      static MyFragment newInstance(int num) {
          MyFragment f = new MyFragment();
  
          // Supply num input as an argument.
          Bundle args = new Bundle();
          args.putInt("num", num);
          f.setArguments(args);
  
          return f;
      }
  
      /**
       * When creating, retrieve this instance's number from its arguments.
       */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          mNum = getArguments() != null ? getArguments().getInt("num") : 1;
      }
  
      /**
       * The Fragment's UI is just a simple text view showing its
       * instance number.
       */
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          View v = inflater.inflate(R.layout.fragment_pager_list, container, false);
          View tv = v.findViewById(R.id.text);
          ((TextView)tv).setText("Fragment #" + mNum);
          return v;
      }
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) {
          super.onActivityCreated(savedInstanceState);
          setListAdapter(new ArrayAdapter&lt;String&gt;(getActivity(),
                  android.R.layout.simple_list_item_1, new String[] {"test1","test2","test3","test4","Test5"}));
      }
  
      @Override
      public void onListItemClick(ListView l, View v, int position, long id) {
          Log.i("FragmentList", "Item clicked: " + id);
      }
  }
  
  }
  </code></pre>
  
  <p>basically when it gets to the end how can I have it show the first fragment as it would go to any other fragment?</p>
  
  <p>ie. <code>A-&gt;B</code>,
        <code>B-&gt;C</code>,   <code>C-&gt;A</code>  and backwards   <code>A-&gt;C</code>, <code>C-&gt;B</code>, <code>B-&gt;A</code> </p>