开发者

Provider "gps" unknown exception while trying to removeTestProvider

开发者 https://www.devze.com 2023-04-06 23:34 出处:网络
Does anyone know why or has resolved this issue I\'m having: 09-21 11:49:45.007: WARN/System.err(22711): java.lang.IllegalArgume开发者_高级运维ntException: Provider \"gps\" unknown

Does anyone know why or has resolved this issue I'm having:

09-21 11:49:45.007: WARN/System.err(22711): java.lang.IllegalArgume开发者_高级运维ntException: 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.


I think removeTestProvider(TEST_PROVIDER) only works after you've called addTestProvider(TEST_PROVIDER).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号