title: How to set image to a view holder asynchronously
body: <p>I defined a view holder in a custom list adapter </p>
  
  <pre><code>viewHolder.albumArt = (ImageView) convertView.findViewById(R.id.album_art);
  </code></pre>
  
  <p>I initially used this line to set an image to the view object referenced by the holder</p>
  
  <pre><code>viewHolder.albumArt.setImageBitmap(
       BitmapFactory.decodeFile(songObject.albumArtURI));
  </code></pre>
  
  <p>But the scrolling experience was a little laggy so I tried to use asynchronous image loading</p>
  
  <pre><code>// viewHolder.albumArt.setImageBitmap(
       // BitmapFactory.decodeFile(songObject.albumArtURI));
  
  ImageLoader().execute(songObject.albumArtURI);
  </code></pre>
  
  <p>But now I'm having trouble implementing the Asynch class. Specifically, I'm need to be able to pass <code>viewHolder.albumArt</code> and <code>songObject.albumArtURI</code> together, but I can only pass one variable at a time.</p>
  
  <pre><code>public class ImageLoader extends AsyncTask&lt;URI, Void, Bitmap&gt; {
  
      @Override
      protected Bitmap doInBackground(URI... uri) {
  
          return BitmapFactory.decodeFile(uri);
      }
  
      @Override
      protected void onPostExecute(Bitmap bitmap) {
  
          // This is my problem here
          viewHolder.albumArt.setImageBitmap(BitmapFactory.decodeFile(bitmap));
      }
  }
  </code></pre>