1

I want to call some activity by clicking on one button inside info view adapter of marker of google map. is this possible, then how?

My code is like that

// Info view adapter
googleMap.setInfoWindowAdapter(new InfoWindowAdapter() {


     @Override 
     public View getInfoWindow(Marker marker) { 

         view = ((Activity) context).getLayoutInflater().inflate(R.layout.row_browse_jobs_map,null);
         txtDate = (TextView) view.findViewById(R.id.txt_browse_jobMap_placed_date);
         String j_date = "25 JAN, 2015";

         //click listener for button
         txtDate.setOnClickListener(new OnClickListener() {

              public void onClick(View arg0) {
                  Toast.makeText(context, "clicked", Toast.LENGTH_SHORT).show(); 
              } 
         });
         return view; 
     }

     //content wraping
     public View getInfoContents(Marker arg0) {  
         return null; 
     } 
}); 

1 Answers1

1

Please check this. I didn't tried this. so i am not sure this is correct or not.

public View getInfoContents(Marker arg0) {
     googleMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {            
         public void onInfoWindowClick(Marker marker) {
              //your code
            }    
     }
      //your remaining code
 }

Refer this set InfoWindowAdapter show information only for first marker clicked

Community
  • 1
  • 1
Emil
  • 2,786
  • 20
  • 24
  • Hello Boss, Thank you for the response but this method is for clicking on whole info window. but in my scenario i want to add click event only on the view inside custom info window, not whole info window. – Maitri Shah Aug 01 '15 at 07:19
  • check this out http://stackoverflow.com/questions/16604020/how-perform-click-operation-on-marker-custom-info-window-on-google-map-v2-in-and – Emil Aug 01 '15 at 07:47
  • yehhhh... thnks i got it from your link.. that is http://stackoverflow.com/questions/14123243/google-maps-android-api-v2-interactive-infowindow-like-in-original-android-go – Maitri Shah Aug 01 '15 at 08:20