Has NETWORK_PROVIDER behavior changed in Android 4.1.1?

会有一股神秘感。 提交于 2019-12-05 04:44:15

The behavior of Android has not changed with regard to the NETWORK_PROVIDER.

I don't know what went wrong or why, but I removed/replaced the battery and SIM card on my Galaxy Nexus and the network provider seems to be providing the correct results.

The lesson for me? Do not assume you will ever get a location reported to your listener, even if you are certain that the network provider is available, enabled and connected.

In my case, I'll need to add another check to make sure my LocationListener does not keep running if I do not get any locations reported.

Sinhyeok

I have read someone's supposition about this problem. It is "In some devices if there is no update after request then a network provider do not give a callback".

Consider that possibility.

In my case, I use a getLastKnownLocation() before starting a current location tracking. Try ctrl+f getLastKnownLocation in this article.

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