title: Infinite ViewPager
body: <p>This seems possible, but I'm having a little trouble figuring out how to implement a <code>ViewPager</code> that can page indefinitely.</p>
  
  <p>My use case is for a calendar that shows a month at a time, but would be able to switch to any month by paging enough times.</p>
  
  <p>Currently I'm just <code>extending PagerAdapter</code>, and 3 custom <code>MonthViews</code> are added like so:</p>
  
  <pre><code>    @Override
      public Object instantiateItem(View collection, int position) {
          final MonthView mv = new MonthView(HistoryMonthActivity.this);
          mv.setLayoutParams(new ViewSwitcher.LayoutParams(
                  android.view.ViewGroup.LayoutParams.MATCH_PARENT,
                  android.view.ViewGroup.LayoutParams.MATCH_PARENT));
          mv.setSelectedTime(mTime);
  
          ((DirectionalViewPager) collection).addView(mv, 0);
  
          return mv;
      }
  </code></pre>
  
  <p>I would like to keep only 3 <code>MonthView</code>s in memory at a time, so that there isn't a huge delay in displaying data from my database on each <code>MonthView</code> when the user is tabbing. So every time a new page is shown, I will need to remove one <code>MonthView</code> and add one <code>MonthView</code>. If anyone has a better idea for the same functionality , I'd love to hear it!</p>
  
  <p>I'm thinking of trying to use a <code>FragmentStatePagerAdapter</code>.</p>