Demo entry 3981081

java

   

Submitted by anonymous on Mar 10, 2016 at 23:14
Language: Java. Code size: 473 Bytes.

private static class ThumbnailTask extends AsyncTask {
 private int mPosition;
 private ViewHolder mHolder;

 public ThumbnailTask(int position, ViewHolder holder) {
  mPosition = position;
  mHolder = holder;
 }

 @Override
 protected Cursor doInBackground(Void...arg0) {
  // Download bitmap here
 }

 @Override
 protected void onPostExecute(Bitmap bitmap) {
  if (mHolder.position == mPosition) {
   mHolder.thumbnail.setImageBitmap(bitmap);
  }
 }
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).