title: How do I disable click on a map marker in android?
body: <p>I've written my custom location listener which checks the user's location in every 10 minutes and updates a marker on the map which denotes the user's location. The problem is that the marker is clickable i.e. it shows a button to get directions to the marker. I want to disable that, how can I do that?</p>
  
  <p>Here's the function which creates/updates the marker</p>
  
  <pre><code> public void updateUserMarker() {
          Double temp_latitude = ((MainActivity)mContext).mLatitude;
          Double temp_longitude = ((MainActivity)mContext).mLongitude;
  
          if(mMap!=null) {
              if (user_marker == null) {
                  MarkerOptions markerOptions = new MarkerOptions().position(new LatLng(temp_latitude, temp_longitude));
                  markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.my_marker_icon));
                  user_marker = mMap.addMarker(markerOptions);
              } else {
                  user_marker.setPosition(new LatLng(temp_latitude, temp_longitude));
              }
          }
  
      }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/iTvdW.png" alt="enter image description here"></p>