title: android - FragmentStatePagerAdapter fragment not visible
body: <p>I have implemented view pager using the FragmentStatePagerAdapter. I have used 3 fragments in the view. The view pager is showing all 3 tabs with views as it should be , now my issue is that the third fragment is not visible but i am able to scroll till third tab and when i scroll back i see the second fragment but again the first fragment vanishes and all i am left is with second fragment. </p>
  
  <pre><code>mPager = (ViewPager)mContext.findViewById(R.id.viewPager);
  mPager.setOnPageChangeListener(this);
  mPagerAdapter = new MyPagerAdapter(mContext.getSupportFragmentManager(),mContext);
  mPager.setAdapter(mPagerAdapter);
  </code></pre>
  
  <p>adapter code is </p>
  
  <pre><code>public class MyPagerAdapter extends FragmentStatePagerAdapter {
  
      private int NUM_PAGES = 3;
      List&lt;Fragment&gt; listFragment = new ArrayList&lt;Fragment&gt;();
      private MyActivity mContext;
  
      public MyPagerAdapter(FragmentManager fragmentManager, MyActivity mActivity) {
          super(fragmentManager);
          this.mContext = mActivity;
          listFragment.add(new FirstFragment());
          listFragment.add(new SecondFragment());
          listFragment.add(new ThirdFragment());
      }
  
      @Override
      public int getItemPosition(Object object){
          return PagerAdapter.POSITION_NONE;
      }
  
      @Override
      public Fragment getItem(int position) {
          Log.v("fragment position",""+position);
          return listFragment.get(position);
      }
  
      @Override
      public int getCount() {
          return NUM_PAGES;
      }
  }
  </code></pre>
  
  <p>I am stuck in this for a while, i would really appreciate some help.Thank you. </p>