Using MyLocationNewOverlay I can show user's current location in my mapview.
mylocation = new MyLocationNewOverlay(mapView);
mylocation.enableMyLocation();
mylocation.enableFollowLocation();
IMyLocationProvider s= mylocation.getMyLocationProvider();
mylocation.getMyLocation();
mapView.getOverlays().add(mylocation);
To create a route, I've tried to get user's current location by mylocation.getMyLocation /mylocation.getLastFix() but both return null. How to retrive the geopoint/lat long points?
If you used
mylocation.getMyLocation()and it returnednullit's because you didn't leaved it enough time to find your location.If we take a look at the source code here:
You get null simply because your location is actually null, same goes for
mylocation.getLastFix()Make sure you wait at least for
runOnFirstFixto end before trying to get your location.Also, the line:
is unnecessary in this context, aside from that, you should be on the right track.