imageview draw issue with asynctask
- by alexb
Have the following asynctask that i'm using to download some images. Works fine except for the very first image, which doesn't always appears unless I do something like move to the next image and then back again.
public class DownloadImageTask extends AsyncTask {
static ImageView _imageView=null;
public DownloadImageTask(ImageView ctl){
_imageView=ctl;
}
protected void onPostExecute(Bitmap result) {
_imageView.setImageBitmap(result);
}
...
}
I thought this might be an issue with updating the UI on a background thread, so I reworked this using an abstract class that invokes a method on the UI thread that calls .setImageBitmap() but I still get the same behaviour - works fine for all images except the first, unless I move to the next image and back again.
Is there a way to force a redraw on the imageview after i set the image?