开发者

How to listen for location updates from multiple providers?

开发者 https://www.devze.com 2023-01-04 20:55 出处:网络
In this code I request location updates from GPS locMan.requestLocationUpd开发者_开发问答ates(LocationManager.GPS_PROVIDER,20000, 1, gpsListener);

In this code I request location updates from GPS

locMan.requestLocationUpd开发者_开发问答ates(LocationManager.GPS_PROVIDER,20000, 1, gpsListener);

But how can I make sure it listens for Wifi or Cell ID updates too?


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


You should be able to call requestLocationUpdates(), with distinct LocationListener objects, for the other providers.

0

精彩评论

暂无评论...
验证码 换一张
取 消