Search code examples
androidpicasso

How to load images from url array to image array?


I have an url array and I have to load all images and put it in image array.

I'm trying this

ImageView tempImageView = (ImageView)findViewById(R.id.temp_image_view);
        for (int j = 0; j < urls.length-1; j++){
            Picasso.with(getApplicationContext()).load(urls[j]).into(tempImageView);
            image[j] = tempImageView.getDrawable();

        }

but it's doesn't work. how can I do it?


Solution

  • Picasso has an oncompletion listener.

    Check this answer

    How to listen for Picasso (Android) load complete events?