title: Android - ListView - calling the getView() on demand
body: <p>I have a <code>ListView</code> which displays in every row an image pulled from the internet, and a string.  </p>
  
  <p>In general it works fine. However I want to take control on the way when the views (rows) are inflated. By default when the row is visible the <code>getView()</code> method of the adapter is called. </p>
  
  <p>This of course is not one of the best behaviours because if I have a <code>ListView</code> with several hundreds of records, and I need to reach the ones at the bottom, while scrolling the <code>ListView</code>, the <code>getView()</code> method will be invoked for every row until I reach the footer.  </p>
  
  <p>So I want to call getView only after scrolling and the ListView is in paused/idle state, but I do not have idea how to go about this:</p>
  
  <p>Here's how I begun:</p>
  
  <pre><code>listView.setOnScrollListener(new OnScrollListener() {
      @Override
      public void onScrollStateChanged(AbsListView view, int scrollState) {
          if(scrollState==SCROLL_STATE_IDLE){
              // Invoke get view only on visible items
          }
      }
  
      @Override
      public void onScroll(AbsListView view, int firstVisibleItem,
              int visibleItemCount, int totalItemCount) {
  
      }
  });
  </code></pre>
  
  <p>This is the getView of my adapter:</p>
  
  <pre><code>@Override
  public View getView(int position, View convertView, ViewGroup parent) {
  
      ViewHolder holder;
  
      if (convertView == null) {
          convertView = mInflater.inflate(R.layout.row, parent, false);
  
          holder = new ViewHolder();
          holder.title = (TextView) convertView.findViewById(R.id.textView);
          holder.image = (ImageView) convertView.findViewById(R.id.imageView);
          holder.position = position;
  
          convertView.setTag(holder);
      } else {
          holder = (ViewHolder) convertView.getTag();
      }
  
  
      holder.title.setText(data.get(position).getTitle());
      holder.image.setImageResource(R.drawable.ic_launcher);
      new LoadImageAsync(data.get(position).getUrl(), holder.image).execute();
  
      return convertView;
  }
  </code></pre>
  
  <p>Please, give me some directions on where should I look in order to achieve this: Call getView() only after scrolling, and only for visible items.</p>