i tried to use databinding to do some late binding...
# android
l
i tried to use databinding to do some late binding of some data to an GoogleMap infowindow. but that doesn’t look like it will work. Is there any other work around to update an infowindow after it is showing?
l
It's basically impossible to make changes to the contents of a infowindow. The only thing you can do is, make the change to a viewmodel (or whatever you're using to populate it), and "re-show" it From the infowindow documentation
Note: The info window that is drawn is not a live view. The view is rendered as an image (using View.draw(Canvas)) at the time it is returned. This means that any subsequent changes to the view will not be reflected by the info window on the map. To update the info window later (for example, after an image has loaded), call showInfoWindow()...
You can read the whole thing here: https://developers.google.com/maps/documentation/android-sdk/infowindows#custom_info_windows
l
hmm, ya i just tried doing this but you get in an infinite loop if you call showInfoWindow() inside of the getInfoContent() function of the GoogleMap.InfoWindowAdapter interface.
looks like i need to do that outside
okay i found a work around
im using rxjava publish subject and inside the subscribe call i call showInfoWindow()
👍 1