开发者

How to listen for location updates from multiple providers?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜