How to refresh image view immediately

后端 未结 4 502
情书的邮戳
情书的邮戳 2020-12-10 03:49

In my android app, I download an image from the cloud. The download is performed in a thread and in that same thread I also set an image view with the newly downloaded image

4条回答
  •  没有蜡笔的小新
    2020-12-10 04:28

    Invalidate doesn't work. Changing the uri or url or the path of the image temporarily and changing back to the required path works. For example, if i have

    image_url="myhost/img.png";
    himg.setImageURI(image_url, imageLoader);
    

    I can refresh this as:

     himg.setImageURI(null, imageLoader);
     himg.setImageURI(image_url, imageLoader)
    

提交回复
热议问题