网络提供商无法在android中工作 [英] network provider not working in android

查看:77
本文介绍了网络提供商无法在android中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须制作一个Android应用程序,在其中我需要找到用户的当前位置.为此,我首先使用GPS提供商,但如果无法使用,我将退回给网络提供商.现在我的手机上有实例,即使网络提供商也无法正常工作,并且该语句network_enabled = lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);

i have to make an android application in which i need to find the current location of the user. For this i am first using the GPS provider, but if it is not available i fall back to the network provider. Now there have been instances on my phone when even the network provider is not working and the statement network_enabled = lm .isProviderEnabled(LocationManager.NETWORK_PROVIDER);

给出了错误的值.

我的问题

我仍然可以通过电话拨打电话,因此我的网络提供商可以正常工作.我需要知道的是网络提供商在什么情况下不起作用?android设备上的网络提供商无法为我提供坐标的情况可能是什么.

i am still able to make calls from my phone, so my network provider is working fine. what i need to know is in what conditions does the network provider not work? what could be the possible scenarios where the network provider on my android device not work to supply me my co-ordinates.

先谢谢您

推荐答案

此问题困扰了两天.我找到了解决方案.只需转到设置->位置&安全性并启用我的位置"组中的标记使用无线网络".

Two days puzzled over this problem. I found a solution. Just go to Settings -> Location & security and enable flag "Use wireless networks" in "My Location" group.

但是现在我有一个问题:该标志的默认状态是什么?如果应用程序必须要求用户启用此标志,将非常可悲.

But now I have the question: what is default state of this flag? It will be very sad if the application would have to ask the user to enable this flag.

这篇关于网络提供商无法在android中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆