Get current position with GPS AND WIFI

纵饮孤独 提交于 2019-12-06 03:35:34

you are using locationmanagers getbestprovider method which simply gets any location provider which most closely matches your criteria. if you want to get a specific location provider then use the getProvider method. the parameter should be one of the results of the getProviders method. some links: http://developer.android.com/guide/topics/location/obtaining-user-location.html http://developer.android.com/reference/android/location/LocationManager.html

If you want to get updates from a specific provider you can use the requestLocationUpdates (String provider, long minTime, float minDistance, LocationListener listener) method of LocationManager. A list of available providers can be obtained using the getProviders(boolean enabledOnly) method.

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