如果关闭gps,获取android中的lastKnownLocation将返回null

时间:2014-08-25 20:11:01

标签: android gps geolocation

我按照android指南获取当前位置(http://developer.android.com/training/location/retrieve-current.html)。

我之前在S3上测试了我的代码,即使GPS关闭,getLastKnownLocation确实返回了一些东西。但是现在在对nexus进行测试之后,我发现getLastKnownLocation仅在GPS完全打开时返回一些位置。

在nexus中,GPS有三个选项:仅设备,关闭,完成。也许这与问题有关。

在我的应用中,即使是低精度的位置也足够了。那么伙计们可能会出现什么问题呢?

0 个答案:

没有答案
相关问题