1

I am using Picasso in my application to load image from a url into an image view. I would like to perform an action, but only once the image has arrived and not when the loading placeholder is visible.

How do I achieve this ?

Thanks!

Shivam Bhalla
  • 1,879
  • 5
  • 35
  • 63

2 Answers2

6

you can use picasso's callback as below

Picasso.with(getContext())
    .load(url)
    .into(imageView, new com.squareup.picasso.Callback() {
                        @Override
                        public void onSuccess() {
                              // do something if its loaded successfully
                        }

                        @Override
                        public void onError() {
                             // do something if its not loaded successfully
                        }
                    });
karan
  • 8,637
  • 3
  • 41
  • 78
1

Use Picasso into method with callback and execute your code when onSuccess() is called.

maciekjanusz
  • 4,702
  • 25
  • 36