title: Android PagerAdapter not calling instantiateItem
body: <p>I'm trying to implement ViewPager with PagerAdapter in my app. I'm mainly working off <a href="http://blog.stylingandroid.com/archives/537" rel="noreferrer">this example</a>.</p>
  <p>My <code>PagerAdapter</code> is called DataPagerAdapter and uses the following constructor and <code>instantiateItem</code>, where I inflate a view from <code>data_list_view.xml</code>:</p>
  <pre><code>public class DataPagerAdapter extends PagerAdapter
      implements TitleProvider {
      private LayoutInflater mInflater;
      
      private static String[] titles = new String[]
      {
          &quot;Page 1&quot;,
          &quot;Page 2&quot;,
          &quot;Page 3&quot;
      };
      private final Context context;
   
      public DataPagerAdapter( Context context )
      {
          this.context = context;
      }
   
      @Override
      public String getTitle( int position )
      {
          return titles[ position ];
      }
   
      @Override
      public int getCount()
      {
          return titles.length;
      }
   
      @Override
      public Object instantiateItem( View pager, int position )
      {
          ListView v = (ListView) mInflater.inflate(R.layout.data_list_view, null);
          ((ViewPager)pager).addView( v, 0 );
          return v;
      }
   
      @Override
      public void destroyItem( View pager, int position, Object view )
      {
          ((ViewPager)pager).removeView( (ListView)view );
      }
   
      @Override
      public boolean isViewFromObject( View view, Object object )
      {
          return view.equals( object );
      }
   
      @Override
      public void finishUpdate( View view ) {}
   
      @Override
      public void restoreState( Parcelable p, ClassLoader c ) {}
   
      @Override
      public Parcelable saveState() {
          return null;
      }
   
      @Override
      public void startUpdate( View view ) {}
  }
  </code></pre>
  <p>And in my activity I get my adapter:</p>
  <pre><code>DataPagerAdapter adapter = new DataPagerAdapter( this );
  </code></pre>
  <p>And then later I want to refer to my dataListView in code:</p>
  <pre><code>dataListView = (ListView) findViewById(R.id.listViewData);
  </code></pre>
  <p>Problem is, the <code>dataListView</code> is returned as null by the <code>findViewById</code> call since the <code>instantiateItem</code> is never processed.</p>
  <p>When is <code>instantiateItem</code> called and is this done automatically (as the example seems to suggest) or do I have to force it somehow?</p>