简体   繁体   中英

LocationManager exception Provider “gps” unknown

This is related to my own question here: LocationManager exception

Now that I have no permission issue - same line of code gives me exception:

Caused by: java.lang.IllegalArgumentException: Provider "gps" unknown
        at android.os.Parcel.readException(Parcel.java:1251)
        at android.os.Parcel.readException(Parcel.java:1235)
        at android.location.ILocationManager$Stub$Proxy.setTestProviderEnabled(ILocationManager.java:942)

EDIT: From what I read - I need to use Eclipse or DDMS. But I use IntelliJ How do I mock locations using my setup?

It seems that setTestProviderStatus deprecated. Googling and searching didn't help. Some information from book gave me clue that those absolete. Instead, need to mock locations using DDMS when using emulator or device. So, I tried go that route and it seems to be working.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM