Gps - minTime in Android 2.3.4 not working

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

Comic... i ve tested in an android 1.6 and 2.3.3 a very simple gps location... with basically this:

LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); Location myLocation = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER); lm.requestLocationUpdates( LocationManager.GPS_PROVIDER, 10000, 0, listener);

i ve tested in both [1.6 and 2.3.3] with the 10 seconds waiting for the notifiers [showing a toast at onLocationChanged...] BUT STRANGELY in an 2.3.4 version of android it simply ignores the minTime [does not matter if it is 10000 or 120000] it keep looking for changes all the time...

Anyone with this problem? Maybe it is not in the 2.3.4 the problem but anyone else had this problem too?

Answers

This is working as documented. minTime is a suggestion, not a rule. Quoting the documentation:

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.

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/7616431/mintime-in-android-2-3-4-not-working

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils