title: How to avoid creating first fragment before setCurrentItem?
body: <p>I am using FragmentActivity and ViewPager to show several fragments.I want to show different fragment each time according to the intent passed to the FragmentActivity.But the problem is when I use setCurrentItem() after setAdapter(), the first Fragment will be always created,how can I avoid this?</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.container_page);
  
      mDemoCollectionPagerAdapter = new FragmentPageAdapter(
              getSupportFragmentManager());
  
      mViewPager = (ViewPager)findViewById(R.id.pager);   
  
      mViewPager.setAdapter(mDemoCollectionPagerAdapter);
  
      Intent intent = getIntent();
      int whichFragment = intent.getIntExtra(Constants.EXTRA_WHICH_FRAGMENT, 0);
  
      mViewPager.setCurrentItem(whichFragment, false);
      setActionBarTitle(whichFragment);
  
      mViewPager.setOnPageChangeListener(this);   
  }
  </code></pre>