title: Optimize way to use ViewPager?
body: <p>I'm writing an application where I need to show some 100 page in ViewPager. There are facility to jump from one index to direct any random index page. Here Every page it self contain list of item.</p>
  
  <p>Now if I just to user ViewPager.current(index) to jump from one to any random index page..then UI get stuck for a moment and then display.</p>
  
  <p>So to avoid this I thought to implement only 7 adapter page view..where these 100(getCount()) page will reuses these 7 page.</p>
  
  <p>But Im'm getting</p>
  
  <pre><code>E/AndroidRuntime(25961): java.lang.IllegalStateException: Fragment already added: ArrayListFragment{24dad9b6 #0 id=0x7f060009}
  E/AndroidRuntime(25961):    at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1192)
  E/AndroidRuntime(25961):    at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:616)
  E/AndroidRuntime(25961):    at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1484)
  E/AndroidRuntime(25961):    at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java. 
  </code></pre>
  
  <p>I'm using <a href="http://developer.android.com/reference/android/support/v4/app/FragmentStatePagerAdapter.html" rel="nofollow">FragmentStatePagerAdapter</a> for adapter implementation.</p>
  
  <p>Following snap of my code I'm using</p>
  
  <pre><code>static final int NUM_ITEMS = 100;
      private int MAX_AVAILABLE_COUNT = 7;
      private ArrayList&lt;ArrayListFragment&gt; listFragment = new ArrayList();
  
      public class MyAdapter extends FragmentStatePagerAdapter {
  
          public MyAdapter(FragmentManager fragmentManager) {
              super(fragmentManager);
  
              for (int i = 0; i &lt; MAX_AVAILABLE_COUNT; i++) {
                  listFragment.add(ArrayListFragment.newInstance(i));
              }
          }
  
          @Override
          public int getCount() {
              return NUM_ITEMS;
          }
  
          @Override
          public Fragment getItem(int position) {
  
              original = position;
  
              if (position &gt;= MAX_AVAILABLE_COUNT - 1) {
                  int newPosition = position % MAX_AVAILABLE_COUNT;
  
                  position = newPosition;
              }
  
              Fragment fragment = listFragment.get(position);
  
              return fragment;
          }
      }
  </code></pre>
  
  <p>Any suggestion what I'm doing wrong here. Or any other suggestion to achieve it!!</p>