title: make a marker clickable only once in android google map v2
body: <p>I am displaying a set of marker in my Google Map and I want to make the makerss clickable only once. If I click on the same marker again I should get a message like <code>"already clicked"</code> or something like that. How can i do it?</p>
  
  <pre><code>  public void getData() {
      JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(DATA_URL,
              new Response.Listener&lt;JSONArray&gt;() {
                  @Override
                  public void onResponse(JSONArray response) {
                      parseData(response);
                  }
              },
              new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
  
  
                  }
              });
  
      //Creating request queue
      RequestQueue requestQueue = Volley.newRequestQueue(this);
  
      //Adding request to the queue
      requestQueue.add(jsonArrayRequest);
  }
  private void parseData(JSONArray array) {
  
  
      for (int i = 0; i &lt; array.length(); i++) {
          JSONObject json = null;
          try {
              json = array.getJSONObject(i);
  
  
              place1 = json.getString("place");
  
  
              Lat1 = json.getString("latitude");
  
  
              Long1 = json.getString("longitude");
              sensor = json.getString("sensor1");
              bin_capacity = json.getString("capacity");
  
  
  
  
  
  
              if (Integer.parseInt(sensor) &gt;= 0 &amp;&amp; Integer.parseInt(sensor) &lt;= 60) {
                  LatLng latLng = new LatLng(Double.parseDouble(Lat1), Double.parseDouble(Long1));
                  arrayLatlong.add(latLng);
  
  
                  for (int j = 0; j &lt; arrayLatlong.size(); j++) {
                      arrayPlace.add(place1);
                      bin.add(bin_capacity);
  
  
                     myMarker= map.addMarker(new MarkerOptions().position(latLng).title(bin_capacity));
                      arrayMarker.add(myMarker);
  
  
  
  
                      map.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
                                                      @Override
                                                       public boolean onMarkerClick(Marker marker) {
  
  
                                                           for (int k = 0; k &lt; arrayMarker.size(); k++) {
  
                                                               if (marker.equals(arrayMarker.get(k))) {
  
                                                                       counter++;
                                                                       capacity.setText("Capacity = "+counter);
  
  
  
                                                                   }
  
          } catch (JSONException e) {
              e.printStackTrace();
          }
  
  
      }
  }
  </code></pre>