问题,要求通过网络位置更新 [英] Problem requesting location updates by network
问题描述
我创建了一个服务,并抓住有关用户的位置数据,以便我可以告诉我的用户附近的地方。我希望这个服务通过网络除了GPS跟踪有2个原因:1)GPS可能没有启用。 2)全球定位系统需要相当多的时间与我的测试手机锁定。
I've created a Service and grabs location data about the user so I can show my users nearby places. I want this Service to track by network in addition to GPS for 2 reasons: 1) GPS may not be enabled. 2) GPS takes quite a bit of time to lock on with my test phone.
在我的服务执行下面一行:
When my Service executes the following line:
mNETEnabled = mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
我收到以下错误:
I get the following error:
11-24 14:00:41.693: ERROR/LocationManagerService(51): isProviderEnabled got exception:
11-24 14:00:41.693: ERROR/LocationManagerService(51): java.lang.IllegalArgumentException: provider=network
11-24 14:00:41.693: ERROR/LocationManagerService(51): at com.android.server.LocationManagerService._isProviderEnabledLocked(LocationManagerService.java:1385)
11-24 14:00:41.693: ERROR/LocationManagerService(51): at com.android.server.LocationManagerService.isProviderEnabled(LocationManagerService.java:1359)
这是为什么?我错过了从清单权限?我有ACCESS_COARSE_LOCATION在我的清单。
Why is this? Am I missing a permission from the Manifest? I have ACCESS_COARSE_LOCATION in my manifest.
推荐答案
您在模拟器中运行的API级别13或更高? Android的问题19857
are you running on emulator at api level 13 or greater? Android issue 19857
这篇关于问题,要求通过网络位置更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!