title: How to draw a dynamic line (route) with Google Maps Android API v2
body: <p>I'm wondering what the best practice is to draw a dynamic route on a map with the Google Maps API v2. I want to have a map that's able to prolong the route while the user is moving. There seems to be the obvious solution by using a Polyline and PolylineOptions. But I just can't find an easy way to add points <strong>after</strong> I instantiated the Polyline. To draw a Polyline is something like this:</p>
  
  <pre><code>PolylineOptions polylineOptions = new PolylineOptions();
  polylineOptions.add(POINT1, POINT2, POINT3);
  Polyline line = googleMap.addPolyline(polylineOptions);
  </code></pre>
  
  <p>But after I passed the line to GoogleMap I can't add any new points to it. Something like</p>
  
  <pre><code>polylineOptions.add(POINT1, POINT2, POINT3);
  </code></pre>
  
  <p>doesn't add anything to my route. </p>
  
  <p>I could just add complete new Polyline. But isn't there a way to prolong just the existing one? I figured out a way by getting all the points of the Polyline, add the new point, and write them back to the line:</p>
  
  <pre><code>List&lt;LatLng&gt; points = line.getPoints();
  points.add(POINT4);
  line.setPoints(points);
  </code></pre>
  
  <p>But it seems to be cumbersome to me. Any ideas?</p>