Android ListView updating of Image Thumbnails using AsyncTask Causes View recycling

后端 未结 3 1647
孤独总比滥情好
孤独总比滥情好 2020-12-13 16:37

I have been trying to get thumbnails to work with an AsyncTask for image files in a ListView. I have been having the common problem of Row Recycling, and thus on scrolling t

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-13 17:07

    Using the AsyncTask.THREAD_POOL_EXECUTOR wil end up running multiple threads to fetch the thumnails. There is no order in the way they run or finisch and set the image for the view. When scrolling back and forth you may end up with the wrong images in your views.

    I tested the AsyncTask.THREAD_POOL_EXECUTOR and it does lead to the wrong image for some views.

提交回复
热议问题