Android Location update

主宰稳场 提交于 2020-01-15 09:32:07

问题


Im writing an android aplication in which is required the actual location of the user, but I'm having trouble acquiring that location.

I'm using a LocationListener to listen for the location update, via Wifi (NETWORK_PROVIDER). The problem is I don't get an update, and I imagine it only happens when I change network. If I don't get updates, I can use lastKnowLocation but it does not provide me with the actual user's location.

Is there a way to force a location update, via NETWORK_PROVIDER?

Cheers


回答1:


Even better, I suggest you look at the new Location APIs in Google Play Services.

There's a training class for them as well.



来源:https://stackoverflow.com/questions/17303399/android-location-update

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