Hey friends i am showing the path as user(smartphone) moves from one location to another in my app. I want to store that path till user explicitly clears it . when I close the application the drawn path gets removed from the map. I want to save that path
Here is my code for drawing polyline in google map
LatLng sydney = new LatLng(latitude,longitude);
myloc= mMap.addMarker(new MarkerOptions().position(phone).title("My Loc"));
now=mMap.addMarker(new MarkerOptions().position(sydney).title(node));
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom((sydney),19.0f));
PolylineOptions pOptions = new PolylineOptions()
.width(10)
.color(Color.GREEN)
.geodesic(true);
for (int z = 0; z < routePoints.size(); z++) {
LatLng point = routePoints.get(z);
pOptions.add(point);
}
line = googleMap.addPolyline(pOptions);
routePoints.add(sydney);