title: Viewpager Adapter getItem always called for index 0 and 1
body: <p>I was just wondering if it is the normal behaviour of <code>viewpager</code> and its adapter to always call the <code>getItem()</code> method for index 0 and 1, even if I immediately set a current position. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>mNewsPagerAdapter = new NewsDetailPagerAdapter(getChildFragmentManager());
  mNewsPagerAdapter.updateNewsList(news);
  
  mViewPager = (ViewPager) mView.findViewById(R.id.horizontal_view_pager);
  mViewPager.setPageMargin(2);
  mViewPager.setPageMarginDrawable(R.color.black);
  
  mViewPager.setAdapter(mNewsPagerAdapter);
  mViewPager.setCurrentItem(mCurrentPositionPager, false);
  </code></pre>
  
  <p>If I switch from my overview activity to my detail activity with this <code>viewpager</code>, the adapter always calls the <code>getItem()</code> method for position 0 and 1 and after that the <code>getItem()</code> method for the position of <code>mOriginalPosition</code> and its neighbors. I was wondering if this is the correct behaviour or if I missed something to implement it in a right way. Thanks for your help :)</p>
  
  <p>Edit: Added my adapter code</p>
  
  <pre><code>public class NewsDetailPagerAdapter extends FragmentStatePagerAdapter {
  
  private SparseArray&lt;Fragment&gt; mPageReferenceMap = new SparseArray&lt;Fragment&gt;();
  
  private ArrayList&lt;News&gt; mNewsList;
  
  public NewsDetailPagerAdapter(FragmentManager fm) {
      super(fm);
  }
  
  /**
   * Setzt die neuen News.
   **/
  public void updateNewsList(ArrayList&lt;News&gt; list) {
      mNewsList = list;
  }
  
  @Override
  public Fragment getItem(int position) {
      Log.d("debug", "getItem position:" + position);
      News newsItem = mNewsList.get(position);
  
  
      NavigationFragment fragment = new NavigationFragment();
  
      mPageReferenceMap.put(position, fragment);
  
      return fragment;
  }
  
  
  @Override
  public int getCount() {
      return mNewsList.size();
  }
  
  @Override
  public int getItemPosition(Object object) {
      return POSITION_NONE;
  }
  
  public Fragment getFragment(int position) {
      return mPageReferenceMap.get(position);
  }
  </code></pre>
  
  <p>}</p>