如何将图像从 url 数组加载到图像数组?

How to load images from url array to image array?

我有一个 url 数组,我必须加载所有图像并将其放入图像数组中。

我正在尝试这个

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();

        }

但这不起作用。我该怎么做?

Picasso 有一个 oncompletion 侦听器。

检查这个答案

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