title: Google Maps Android API v2, how to remove Polylines from the map?
body: <p>I am trying to remove previously added Polyline and redraw new Polyline when the location has been changed. I tried both     </p>
  
  <p><strong>this.routeToDestination.setPoints(pointsToDestination) and 
      this.routeToDestination.remove()</strong></p>
  
  <p>but neither of them worked. </p>
  
  <p>I followed <a href="https://stackoverflow.com/questions/13933411/how-to-draw-a-dynamic-line-route-with-google-maps-android-api-v2">How to draw a dynamic line (route) with Google Maps Android API v2</a> but could not resolved the issue</p>
  
  <pre><code>    @Override
      public void onResume() {
          super.onResume();
  
          routeToDestination = mMap.addPolyline(new PolylineOptions()
                  .add(new LatLng(location.getLatitude(), location.getLongitude()),
                          new LatLng(this.destinationLatitude, this.destinationLongitude))
                  .width(1)
                  .color(Color.DKGRAY)
  
          );
      }
  
     @Override
      public void onLocationChanged(Location location) {
  
          List&lt;LatLng&gt; pointsToDestination = new ArrayList&lt;LatLng&gt;();
          pointsToDestination.add(new LatLng(location.getLatitude(), location.getLongitude()));
          pointsToDestination.add(new LatLng(destinationLatitude, destinationLongitude));
  
          this.routeToDestination.setPoints(pointsToDestination);
      }
  
  }
  </code></pre>