5

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?

vlio20
  • 8,955
  • 18
  • 95
  • 180

1 Answers1

8

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

Jonfor
  • 139
  • 4
  • 15
Manveer Chawla
  • 404
  • 2
  • 6
  • 2
    Link is down. You should have pasted some bits that were meaningful to this question. – Henrique de Sousa Jan 20 '16 at 17:33
  • The new documentation is here: http://square.github.io/picasso/2.x/picasso/. @HenriquedeSousa I believe my answer was apt for the question asked and I also explained how to use executor with Picasso, which was not even asked. A bit of search for documentation would have brought anyone to see how to use Picasso.Builder in new library. Even the new link can be removed in future so better is to understand the concept instead of finding the right link. – Manveer Chawla Jan 21 '16 at 19:43
  • 3
    Quoting the FAQ:Provide context for links: Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline. – Henrique de Sousa Jan 24 '16 at 00:29