googleMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
@Override
public void onMapClick(LatLng point) {
MarkerOptions marker = new MarkerOptions().position(
new LatLng(point.latitude, point.longitude)).title("New Marker");
mMap.addMarker(marker);
System.out.println(point.latitude+"---"+ point.longitude);
}
});}}
In case that code adds a new marker on the map, plus every click I give adds a new marker, so I want to remove the old marker when adding a new one