title: Lazy-loading images in ListView on Android
body: <p>I implemented the lazy-loading images in my <code>ListView</code>.
  I use a <code>AsyncTask</code> to download the image from the internet and bind it to the ImageView in the UIThread.</p>
  
  <p>It's working except that when I scroll the <code>ListView</code> vary fast, the downloaded images sometimes are binded into the wrong items in the list.</p>
  
  <p>I guess the problem is from the reuse of <code>convertView</code> in the <code>BaseAdapter</code>.
  Any ideas to solve it?</p>
  
  <p>Many thanks.</p>
  
  <p>EDIT:
  I post the answer as following:</p>
  
  <pre><code>public void setBitmap(int position, Bitmap image) {
      View itemView = mListView.getChildAt(position - mListView.getFirstVisiblePosition());
      if (itemView != null) {
          ImageView itemImageView = (ImageView) itemView.findViewById(R.id.item_imageview);
          itemImageView.setImageBitmap(image);
      }
  }
  </code></pre>