I am trying to set an ImageView in a Google Maps Marker's InfoWindow and have copied the code from this answer pretty exactly, except that my InfoWindowAdapter isn't an anonymous inner class (it's just an inner class of the activity). This was working before, but for some reason it has stopped working - the onSuccess method in the Callback doesn't get called, so the InfoWindow only displays the image the second time it is opened.
Looking at the logs for Picasso I'm getting messages similar to
Main canceled [R20]+374ms target got garbage collected
I'm not familiar with that answer, but
Target could be gc'ed when you do not hold strong reference to that.
It's because Picasso holds
Target instance with weak reference.
You should hold
Target instance somewhere outside of Picasso.
Check this issue: https://github.com/square/picasso/issues/352