Clear fused location provider's location for testing

情到浓时终转凉″ 提交于 2019-12-02 01:30:41

Google Play Services is central service and serves every app installed on your device. After clearing cache and data, if any app connects with Google Play services on that device(which almost every Google app do), then Fused location api will fetch and save location for that app. After that once your app fetches last known location in onConnected, it will return the location.

It is hard to simulate the scenario your are trying to achieve unless you hard code the values to be blank.

I just disabled the GPS then restarted the Android phone & I found that the locationManager.getLastKnownLocation returned NULL for location.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!