Reputation: 4281
By default marker's infoWindow is closed when map is clicked. Does anyone know how I can disable this behavior?
I tried to override onMapClicked
but it doesn't work...
mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
@Override
public void onMapClick(LatLng arg0) {
//do nothing
}
});
Upvotes: 6
Views: 3253
Reputation: 224
One way to do it would be to keep a class variable that specifies the marker currently selected. You would set it in the onMarkerClick() method. Call it, say, currentMarker. Putting
currentMarker.showInfoWindow();
in the onMapClick() method should then do the trick.
Upvotes: 9