I have a problem with onLocationChanged event in Android. Here's the triggering:
case R.id.start: {
Points.add(overlay.getMyLocation()); // Points' type is ArrayList<GeoPoint>
mgr.requestLocationUpdates(best, 0, 3, locationListener);
}
break;
And here's the onLocationChanged method:
public void onLocationChanged(Location location) {
i++;
Points.add(overlay.getMyLocation());
MapOverlay mapOverlay = new MapOverlay(Points.get(i-1), Points.get(i));
map.getOverlays().add(mapOverlay); //does the drawing
mMapController.animateTo(Points.get(i));
}
So, onLocationChanged is called only once and only after I press "start". It's supposed to be called automatically every time the location has changed, right? In my case, it's not.
Please help me.
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
? – Alcmene