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

前端 未结 7 1268
不知归路
不知归路 2020-12-02 14:11

Is there a way to listen for events from Picasso when using the builder like:

Picasso.with(getContext()).load(url).into(imageView);

I\'m trying

7条回答
  •  甜味超标
    2020-12-02 14:41

    As a complement to other answers, in case you don't know where to use original image view, e.g. ImageView myIV:

    Original:

    Picasso.with(activity).load(url).into(myIV);
    

    New (inside onBitmapLoaded() of new Target()):

    public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
        myIV.setImageBitmap(bitmap);
    }
    

提交回复
热议问题