How to get click event of the marker text

前端 未结 4 978
渐次进展
渐次进展 2020-12-31 00:07

I am displaying google map api v2 in my app. I have set some markers in the map. I have also set title and snippet on the markers which are shown when you click the marker.<

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-31 00:43

    GoogleMap mGoogleMap;  
    mGoogleMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {
    
                        @Override
                        public void onInfoWindowClick(Marker arg0) {
                            Intent intent = new Intent(getBaseContext(), Activity.class);
                            String reference = mMarkerPlaceLink.get(arg0.getId());
                            intent.putExtra("reference", reference);
    
                            // Starting the  Activity
                            startActivity(intent);
                            Log.d("mGoogleMap1", "Activity_Calling");
                        }
                    });
    

提交回复
热议问题