问题
I have a problem recieving notifications from LocationManager after a set period of time:
locationManager = (LocationManager)getSystemService(LOCATION_SERVICE);
if(useGPS) {
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 999999,
999999, locationListener);
In emulator my location listener's onLocationChanged method gets called whenever I send a fix via emulator control (i.e. every other second) So, the question is - is this because the way I'm testing on emulator, or LocationManager doesn't respect params?
Thanks
回答1:
The doc says:
minTime - the minimum time interval for notifications, in milliseconds. This field is only used as a hint to conserve power, and actual time between location updates may be greater or lesser than this value.
来源:https://stackoverflow.com/questions/4418018/android-locationmanager-requestlocationupdates-doesnt-respect-params