Android picasso multi-thread

六月ゝ 毕业季﹏ 提交于 2019-12-07 13:26:57

问题


I looked over the documentation of Picasso and couldn't see anything about threading. What will happen if I run something like this (for ListView):

for(String url : urlArray)
{
    Picasso.with(context).load(url).into(Holder.imageView);
}

would the images load parallely or one by one?


回答1:


Picasso uses a thread pool executor for loading images in background. Once downloading is complete it loads the image using UI thread. You can also configure it to use thread pool executor supplied by you, if you want to share it with the one already used in the app. See the documentation of Picasso.Builder which has a parameter for executor, https://square.github.io/picasso/2.x/picasso/.



来源:https://stackoverflow.com/questions/21862702/android-picasso-multi-thread

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!