How to listen to location updates from multiple providers?

In this code, I request location updates from GPS

locMan.requestLocationUpdates(LocationManager.GPS_PROVIDER,20000, 1, gpsListener);

But how can I make sure it also listens for Wi-Fi or Cell ID updates?

+3
source share
2 answers

You should be able to call requestLocationUpdates(), with various objects LocationListener, for other suppliers.

+3
source

Actually, you can use the same listener. Just the Location.getProvider () user in the listener to find out which provider generated the update.

+6
source

Source: https://habr.com/ru/post/1751655/


All Articles