1

I want to show new activity when user touch the info(snippet?) above marker. As I'm new comer for android, I studied alone and completed by custom marker and snippet. But I can not give a click event to snippet. I already checked for How to get click event of the marker text this post but it is hard to perform on my code. At the start "InfoWindowAdapter" it couldn't read it(can not resolve...)

I found second answer Android Google Maps V2 - OnInfoWindowClick on several markers it looks find except one part.

allMarkerMap.put(mk1, Don.class);
mMap.setOnInfoWindowClickListener(this);

Above post, it said that it works but at my one it has red line on "this" next to mMap.setOnInfoWindowClickListener. I put it on several position such as under onCreate, onMapready but it didn't work.

Community
  • 1
  • 1
dalami0i
  • 25
  • 8

1 Answers1

0

If you look closely at the code provided in your link you will notice the following line:

public class MainActivity extends Activity implements OnInfoWindowClickListener {

Which means the Activity implements the OnInfoWindowClickListener interface. If you want to use mMap.setOnInfoWindowClickListener(this); make sure this (which in the provided link is the Activity) implements the listener.

By implementing the OnInfoWindowClickListener it will force you to implement the onInfoWindowClick(marker) method.

Community
  • 1
  • 1
Kilian
  • 275
  • 2
  • 8
  • Thank you! I need to step by step from the basic....... ha...... anyway it works! Thank you Kilian! – dalami0i Oct 21 '16 at 01:42