Target.onBitmapLoaded() method not called the first time after completed (network) request.
See original GitHub issueonBitmapLoaded() is not called immediately after fetching has been completed. But when I load the image second time (which I suppose is already cached) the method is indeed called.
The code I use:
Picasso.with(this)
.load(pictureUrl)
.into(new Target() {
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
// not being called the first time
}
@Override
public void onBitmapFailed(Drawable errorDrawable) {
}
@Override
public void onPrepareLoad(Drawable placeHolderDrawable) {
}
});
Picasso version: 2.1.1
Issue Analytics
- State:
- Created 10 years ago
- Comments:19 (3 by maintainers)
Top Results From Across the Web
onBitmapLoaded of Target object not called on first load
It will manage the WeakReference objects for each of your views - as soon as one is no longer needed, whatever Target processing...
Read more >Using Picasso in Android | Engineering Education (EngEd ...
It ensures the image is not downloaded every time it is needed. Fading: This refers to an animation feature offered by Picasso. Supports ......
Read more >Android – Picasso not loading bitmap into imageview with target ...
Here's a complete method. First it reads image size without decoding the content itself. Then it finds the best inSampleSize value, it should...
Read more >Target (picasso 2.71828 API)
Represents an arbitrary listener for image loading. Objects implementing this class must have a working implementation of Object.equals(Object) and Object.
Read more >Networking - Android Mobile App Development Guide - Peruzal
It was one of the first networking libraries released for Android and provides ... To verify network availability you can then define and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Given the number of people (myself included the first time I used a Target) who make this mistake, wouldn’t it be wiser to add some sort of “bigger” warning?
@lukasz1 : Finally found solution here:- http://www.opensourcealternative.org/tutorials/android-tutorials/android-picasso-save-image-tutorial/