title: mMap.clear in some other function is removing marker from public void onMapLongClick(LatLng latLng)?
body: <p>so i have a function</p>
  <pre><code> public void centerOnMapLocation (Location location, String title) {
  
          if (location != null) {
              LatLng userLocation = new LatLng(location.getLatitude(), location.getLongitude());
              mMap.clear();
              mMap.addMarker(new MarkerOptions().position(userLocation).title(title));
              mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(userLocation, 13));
          }
      }
  </code></pre>
  <p>in android map activity and i implemented onMapLongClick(LatLng latLng)</p>
  <pre><code>  @Override
      public void onMapLongClick(LatLng latLng) {
  
          String addressTitle = &quot;&quot;;
          Geocoder geocoder = new Geocoder(this, Locale.getDefault());
          try {
              ArrayList&lt;Address&gt; addressArrayList = (ArrayList&lt;Address&gt;) geocoder.getFromLocation(latLng.latitude, latLng.latitude, 1);
  
              if (addressArrayList != null &amp; addressArrayList.size() &gt; 0) {
                  if (addressArrayList.get(0).getAddressLine(0) != null) {
  
                      addressTitle += addressArrayList.get(0).getAddressLine(0);
  
                  }
              }
  
          } catch (IOException e) {
              e.printStackTrace();
          }
  
          mMap.addMarker(new MarkerOptions().position(latLng).title(addressTitle));
  
      }
  </code></pre>
  <p>in maps activity and inside the function i added a marker . but on long click the marker vanishes and when i remove<br />
  &quot; mMap.clear() &quot; from the previous function &quot;centerOnMapLocation&quot; then I'm able to add back the marker and it stays there .</p>
  <p>My question is I'm not even calling that function in onMapLongClick but when i remove mMap.clear(); from the other function . I'm able to add markers inside it ?? What I'm doing wrong</p>