Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException: provider doesn't exisit: null #4

Open
lingling-fan opened this issue Sep 11, 2017 · 1 comment
Open

IllegalArgumentException: provider doesn't exisit: null #4

lingling-fan opened this issue Sep 11, 2017 · 1 comment

Comments

@lingling-fan
Copy link

//package name: com.dgmltn.morphclock.app
//version: 1.0.1
//target sdk version: android-18
java.lang.RuntimeException: Unable to resume activity {com.dgmltn.morphclock.app/com.dgmltn.morphclock.app.MainActivity}: java.lang.IllegalArgumentException: provider doesn't exisit: null
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2790)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2819)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2266)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: provider doesn't exisit: null
at android.os.Parcel.readException(Parcel.java:1435)
at android.os.Parcel.readException(Parcel.java:1385)
at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:540)
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:836)
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:430)
at com.dgmltn.morphclock.app.SkyView.startTicking(SkyView.java:90)
at com.dgmltn.morphclock.app.MainActivity.onResume(MainActivity.java:140)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
at android.app.Activity.performResume(Activity.java:5211)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2780)

@lingling-fan
Copy link
Author

The provider(network or gps) is null or doesn't exist on some device, so even if you start corresponding services, it still doesn’t work. Better check it like this:

if(locationManager.getAllProviders().contains("network")) {
     locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, time, distance, this);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant