You will need to extract the location value from onLocationChanged
to a Class Variable. For example :
public Location curLoc = new Location();
Then inside your onLocationChanged()
, pass the value of location
into curLoc
, like this : curLoc=location
Then on your Polyline, use curLoc.getLatitude()
and curLoc.getLongitude()
I hope this is helpful, good luck ^^