title: how to create circular viewpager?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7546224/viewpager-as-a-circular-queue-wrapping">ViewPager as a circular queue / wrapping</a>  </p>
  </blockquote>
  
  
  
  <p>I have three fragment classes in my code.
   FirstActivity,SecondActivity,ThirdActivity i want to swipe these three activities.. these three are extend from Fragment class</p>
  
  <pre><code>public class ViewPagerFragmentActivity extends FragmentActivity {
  private PagerAdapter mPagerAdapter;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      requestWindowFeature(Window.FEATURE_NO_TITLE);
      super.onCreate(savedInstanceState);
      super.setContentView(R.layout.viewpager_layout);
      initialisePaging();
      }
  
  /**
   * Initialize the fragments to be paged
   */
  List&lt;Fragment&gt; fragments = new Vector&lt;Fragment&gt;();
  ViewPager pager;
  private void initialisePaging() {
      fragments.add(Fragment.instantiate(this, FirstActivity.class.getName()));
      fragments.add(Fragment.instantiate(this, SecondActivity.class.getName()));
      fragments.add(Fragment.instantiate(this, ThirdActivity.class.getName()));
      this.mPagerAdapter = new MyPagerAdapter(super.getSupportFragmentManager(), fragments);
      pager = (ViewPager) super.findViewById(R.id.viewpager);
      pager.setAdapter(this.mPagerAdapter);
  
  }
  </code></pre>
  
  <p>}</p>
  
  <blockquote>
    <p>and here is my FragmentPageAdapter class</p>
  </blockquote>
  
  <pre><code>public class MyPagerAdapter extends FragmentPagerAdapter {
  
  private final List&lt;Fragment&gt; fragments;
  
  
  public MyPagerAdapter(FragmentManager fm, List&lt;Fragment&gt; fragments) {
      super(fm);
      this.fragments = fragments;
  }
  
  
  @Override
  public Fragment getItem(int position) {
      System.out.println("position"+position);
      return this.fragments.get(position);
  }
  
  
  @Override
  public int getCount() {
      return this.fragments.size();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>my code is working in this way  <code>A&lt;-&gt;B&lt;-&gt;c</code>
  but my requirement is to run  like this way<code>C&lt;-&gt;A&lt;-&gt;B&lt;-&gt;C&lt;-A-&gt;</code>
  that is in circular fragments are swipable...</p>