Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android picasso multi-thread

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?

like image 725
vlio20 Avatar asked Mar 21 '23 13:03

vlio20


1 Answers

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/.

like image 69
Manveer Chawla Avatar answered Apr 01 '23 06:04

Manveer Chawla