I am doing the MyLocationOverlay extension as an inner class of my MapActivity . Then I override onLocationChanged and use animateTo in my MapController in this method.
@Override public synchronized void onLocationChanged(Location location) { if (location != null) { mapController.animateTo( new GeoPoint((int) (location.getLatitude()*1e6), (int) (location.getLongitude()*1e6)); } super.onLocationChanged(location); }
source share