Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Adapter load image and change view visibility in asynctask
// Using an AsyncTask to load the slow images in a background thread
new AsyncTask<ViewHolder, Void, Bitmap>() {
private ViewHolder v;
protected Bitmap doInBackground(ViewHolder... params) {
v = params[0];
return mFakeImageLoader.getImage();
protected void onPostExecute(Bitmap result) {
if (v.position == position) {
// If this item hasn't been recycled already, hide the
// progress and set and show the image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.