title: ViewPager.setOffscreenPageLimit not working
body: <p>I am writing an application where I need to show Expandable List View inside Page Viewer using FragmentStatePagerAdapter.</p>
  
  <p>I am aware about ViewPager page cache limit which we can set using <code>PageViewer.OffscreenPageLimit()</code> which is default as one.</p>
  
  <p>Here I observe, after expand page-1 list it will remain as it is even I visit 7-10 page and come back. and might be because of it ViewPager become heavy while scrolling.</p>
  
  <p>Page Viewer implementation:</p>
  
  <pre><code>private class DataCardSlidePagerAdapter extends FragmentStatePagerAdapter {
  
          public DataCardSlidePagerAdapter(FragmentManager fm) {
              super(fm);
  
              for (int i = 0; i &lt; NUM_PAGES; i++) {
                  DataCardSlidePageFragment fragment = new DataCardSlidePageFragment();
                  Bundle bundle = new Bundle();
                  bundle.putInt("page", i);
                  fragment.setArguments(bundle);
                  dataCardList.add(fragment);
              }
          }
  
          @Override
          public Fragment getItem(int position) {
              return dataCardList.get(position);
          }
  
          @Override
          public int getCount() {
              return NUM_PAGES;
          }
      }
  </code></pre>
  
  <p>where dataCardList is and ArrayList that hold Fragment class object ;</p>
  
  <p><code>dataCardList = new ArrayList&lt;DataCardSlidePageFragment&gt;();</code>  <strong>I am worrying about this call since there are possibility view pager may need to show 500+ page...omg what will be in that case. Any idea if can only use max(say 5, 2 left, 1 centre, 2 right) instead to maintain 500 fragment in list.</strong></p>
  
  <p>This is Async Task Execution From DataCardSlidePageFragment fragment: </p>
  
  <pre><code>class AsyncProcessData extends AsyncTask&lt;Void, Void, Void&gt; {
  
          @Override
          protected void onPreExecute() {
              super.onPreExecute();
  
              dateMap.clear();
              deptList.clear();
          }
  
          @Override
          protected Void doInBackground(Void... params) {
              loadData();
              return null;
          }
  
  
          @Override
          protected void onPostExecute(Void result) {
              super.onPostExecute(result);
  
              //create the adapter by passing your ArrayList data
              cardAdapter = new VitalCardAdapter(parentActivity, deptList);
              //attach the adapter to the list
              expandableList.setAdapter(vitalCardAdapter);
  
              expandGroup(0); // expand first group
          }
      }
  </code></pre>
  
  <p>and following <a href="http://www.mysamplecode.com/2012/10/android-expandablelistview-example.html" rel="nofollow">http://www.mysamplecode.com/2012/10/android-expandablelistview-example.html</a> to create adapter.</p>
  
  <p>Is there anything I am missing here?</p>