I want to use Picasso to load three consecutive images one on top of each other in a listview. Using the methods Picasso provides makes this easy. However because these imag
Here is a simple example how to impement Picasso picture loading callback:
Picasso.with(MainActivity.this)
.load(imageUrl)
.into(imageView, new com.squareup.picasso.Callback() {
@Override
public void onSuccess() {
//do smth when picture is loaded successfully
}
@Override
public void onError() {
//do smth when there is picture loading error
}
});
On the latest Picasso's version, onError recives an Exception as parameter and uses get() instead of with()
Picasso.get()
.load(imageUrl)
.into(imageView, new com.squareup.picasso.Callback() {
@Override
public void onSuccess() {
//do smth when picture is loaded successfully
}
@Override
public void onError(Exception ex) {
//do smth when there is picture loading error
}
});