提供商“gps”尝试删除TestProvider 时出现未知异常
有谁知道为什么或已经解决了我遇到的这个问题:
09-21 11:49:45.007: WARN/System.err(22711): java.lang.IllegalArgumentException: Provider "gps" unknown
09-21 11:49:45.007: WARN/System.err(22711): at android.os.Parcel.readException(Parcel.java:1251)
09-21 11:49:45.007: WARN/System.err(22711): at android.os.Parcel.readException(Parcel.java:1235)
09-21 11:49:45.007: WARN/System.err(22711): at android.location.ILocationManager$Stub$Proxy.removeTestProvider(ILocationManager.java:889)
09-21 11:49:45.007: WARN/System.err(22711): at android.location.LocationManager.removeTestProvider(LocationManager.java:1008)
这个答案 无法解决,因为我什至没有进入已弃用的方法。它在尝试删除提供程序时首先失败。
这是错误吗?
编辑:
在我的代码中,我检查列表中提供者“gps”是否存在:
final String TEST_PROVIDER = LocationManager.GPS_PROVIDER; // "gps"
if (mLocationManager.getProvider(TEST_PROVIDER) != null) {
mLocationManager.removeTestProvider(TEST_PROVIDER);
}
奇怪的是它之前工作过。
Does anyone know why or has resolved this issue I'm having:
09-21 11:49:45.007: WARN/System.err(22711): java.lang.IllegalArgumentException: Provider "gps" unknown
09-21 11:49:45.007: WARN/System.err(22711): at android.os.Parcel.readException(Parcel.java:1251)
09-21 11:49:45.007: WARN/System.err(22711): at android.os.Parcel.readException(Parcel.java:1235)
09-21 11:49:45.007: WARN/System.err(22711): at android.location.ILocationManager$Stub$Proxy.removeTestProvider(ILocationManager.java:889)
09-21 11:49:45.007: WARN/System.err(22711): at android.location.LocationManager.removeTestProvider(LocationManager.java:1008)
This answer does not solve since I don't even get into the deprecated method. It fails first while trying to remove the provider.
Is this a bug?
EDIT:
In my code I check the existence of the provider "gps" in the list:
final String TEST_PROVIDER = LocationManager.GPS_PROVIDER; // "gps"
if (mLocationManager.getProvider(TEST_PROVIDER) != null) {
mLocationManager.removeTestProvider(TEST_PROVIDER);
}
Weird thing is that it was working before.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为 removeTestProvider(TEST_PROVIDER) 仅在您调用 addTestProvider(TEST_PROVIDER) 之后才有效。
I think removeTestProvider(TEST_PROVIDER) only works after you've called addTestProvider(TEST_PROVIDER).