In Xamarin, how do I add an OnInfoWindowClickListener to a Google map?
I have read that:
You can use an OnInfoWindowClickListener to listen to click events on
an info window. To set this listener on the map, call
GoogleMap.setOnInfoWindowClickListener(OnInfoWindowClickListener).
When a user clicks on an info window, onInfoWindowClick(Marker) will
be called
The resource is here:
https://developers.google.com/maps/documentation/android/infowindows
This is the interface code I have added:
public interface onInfoWindowClickListener {
void onInfoWindowClick(Marker marker);
}
I have added this method:
public void onInfoWindowClick(Marker marker)
{
//Toast.MakeText (MapWithMarkersActivity.this, String.Format ("InfoWindow is Clicked"), ToastLength.Short).Show ();
}
I am getting an error at this line of code:
_map.SetOnInfoWindowClickListener (new onInfoWindowClickListener());
The error is this:
Cannot create an instance of the abstract class or interface
'onInfoWindowClickListener'
Can I please have some help?
Thanks in advance
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…