Geolocation - Android Location Service Can I use a single location listener for both GPS and Network Location

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

Do I register a single locationlistener object for both network location and gps location or do I create a separate one for each?

Answers

You can use the same listener for both.

When you get the onLocationChanged() or onStatusChanged() callback you can examine the incoming parameters (location or provider) to determine the source of the callback (ie: Network or GPS).

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/10758572/android-location-service-can-i-use-a-single-location-listener-for-both-gps-and

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils