So basically I have two markers: one is for the destination (which is just static meaning it does not move) and the other marker is dynamic and updates its position based on the current location.
I was able to draw a polyline on a route between the two markers. The only problem is when updating the current location, the previous polyline which was drawn from the previous position of the dynamic marker is still there.
Here is the image:
)
As you can see in the image, the marker is the dynamic one which points to the current location and the polyline from the marker's previous position is located at the University of San Carlos just at the upper-right position of the marker in the image. The destination marker is not shown in this image.
How do I remove the previous polyline? I tried using the method remove() from the Polyline class but it didn't work.
I based my code from this link: Answer : Draw path between two points using Google Maps Android API v2