Issue
I'm using this line to generate a title for the marker-
mMap.addMarker(new MarkerOptions().position(latLng).title("Last location"));
Then if I set onMarkerClickListener
mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
@Override
public boolean onMarkerClick(Marker marker) {
Toast.makeText(MapsActivity.this, "Clicked on marker", Toast.LENGTH_SHORT).show();
return true;
}
Marker title wouldn't show. I need to show both, toast and marker title; how to do that, if it is possible?
Solution
Add a line marker.showInfoWindow();
inside the onMarkerClick method.
Answered By - Aman Jain
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.