Android的位置监听器 [英] android Location Listener

查看:136
本文介绍了Android的位置监听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想聆听来自同一个侦听和实施

i want to listen to both GPS and NETWORK location provider from the same listener and implementation

这是正确的这样做:

        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,metersToUpdate,this);
        locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,0,metersToUpdate,this);

将它的用户同样的方法为供应商?

will it user the same methods for both providers ?

推荐答案

谷歌称这里

您也可以要求从两个GPS,并通过调用requestLocationUpdates(网络位置提供位置更新)两次,一次NETWORK_PROVIDER和一次GPS_PROVIDER。

You can also request location updates from both the GPS and the Network Location Provider by calling requestLocationUpdates() twice—once for NETWORK_PROVIDER and once for GPS_PROVIDER.

这篇关于Android的位置监听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆