Android OnInfoWindowClickListener() never called

TheModularMind picture TheModularMind · Jan 11, 2013 · Viewed 7.3k times · Source

I'm creating an application with new Google Maps API V2 and I have to intercept the click on InfoWindow, showed when a Marker is clicked.

Reading the documentation I assumed that I do that to listen to InfoWindows clicks :

 mGoogleMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {

        @Override
        public void onInfoWindowClick(Marker marker) {

            Log.d("", marker.getTitle());   
        }
    });

But unfortunatly the method is never called.

If I try to listen to marker click and use setOnMarkerClickListener instead of OnInfoWindowClickListener , this works fine.

Hope to find some help, thanks in advance

Answer

Lefteris picture Lefteris · Jan 12, 2013

The OnInfoWindowClickListener gets called when you actually click on the Marker title popup and not the marker.

The above just works fine.