3

I am successfully loading an image into an infowindow by using picasso but I'm running into a small problem. The image only appears after closing and reopening the infowindow a second time.

Here is how picasso is being called

Picasso.with(MapsActivity.this).load(url).error(R.drawable.picturemissing).into(camerashot, new InfoWindowRefresher(marker));

and this is the callback

private class InfoWindowRefresher implements Callback {
    Marker marker=null;

    InfoWindowRefresher(Marker marker) {
        this.marker=marker;
    }

    @Override
    public void onSuccess() {
        if (marker != null && marker.isInfoWindowShown()) {
            marker.hideInfoWindow();
            marker.showInfoWindow();
        }
    }

    @Override
    public void onError() {}
} 

I've already tried setting a flag where picasso is called for 1st time called (similar to this SO post) without change.

What changes do I need to apply to make it so the image is loaded the 1st time?

---update---

So, I decided to forgo the infowindow altogether and instead used a modal fragment. I found this process to always work and it also gave a lot more flexibility in what additional info if any I needed/wanted. Since it was a modal positioning wasn't necessary.

Micah Montoya
  • 757
  • 1
  • 8
  • 24

0 Answers0