title: How to specify onMarkerclick() for different types of markers in android
body: <p>On google map i am placing different colors of markers for different purposes, here i want different functionality for onMarkerclick() for each marker( ex:all green color markers).How to make condition for this.here is my code to create one set of markers</p>
  
  <pre><code>@Override
  public void onMapLongClick(LatLng touchlocation) {
      // TODO Auto-generated method stub
      googleMap.addMarker(new MarkerOptions()
              .position(touchlocation)
              .title("Event")
              .icon(BitmapDescriptorFactory
                      .defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));
  }
  </code></pre>
  
  <p>Here another type of marker</p>
  
  <pre><code>// adding marker
          user_marker = googleMap.addMarker(new MarkerOptions()
                  .position(USER_LOCATION)
                  .title("User")
                  .snippet("User registered Location:" + loc)
                  .icon(BitmapDescriptorFactory
                          .defaultMarker(BitmapDescriptorFactory.HUE_ROSE)));
  </code></pre>
  
  <p>For nearby places i am using another type of marker</p>
  
  <p>here how i implemented onMarkerClick()</p>
  
  <pre><code>@Override
  public boolean onMarkerClick(Marker marker) {
      // TODO Auto-generated method stub
      // googleMap.clear();
      Toast.makeText(getApplicationContext(), "USER MARKER",
              Toast.LENGTH_LONG).show();
      showDialog(DIALOG_LOGIN);
  
      return true;
  }
  </code></pre>
  
  <p>here i want different functionality for each type of marker ,how to write a condition for that.help me.</p>