当我在多个活动中使用点火位置时,在 MyActivity() 中调用 super.onPause() 时,我在 onPause() 中得到以下异常。
E/AndroidRuntime(28968): FATAL EXCEPTION: main
E/AndroidRuntime(28968): java.lang.RuntimeException: Unable to pause activity {com.mypackage.myapp/com.mypackage.myapp.MyActivity}: java.lang.IllegalArgumentException: Receiver not registered: com.github.ignition.location.IgnitedLocationManager$2@419a91f8
E/AndroidRuntime(28968): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2838)
E/AndroidRuntime(28968): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2794)
E/AndroidRuntime(28968): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2772)
E/AndroidRuntime(28968): at android.app.ActivityThread.access$800(ActivityThread.java:130)
E/AndroidRuntime(28968): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1212)
E/AndroidRuntime(28968): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(28968): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(28968): at android.app.ActivityThread.main(ActivityThread.java:4745)
E/AndroidRuntime(28968): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(28968): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(28968): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
E/AndroidRuntime(28968): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime(28968): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(28968): Caused by: java.lang.IllegalArgumentException: Receiver not registered: com.github.ignition.location.IgnitedLocationManager$2@419a91f8
E/AndroidRuntime(28968): at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:654)
E/AndroidRuntime(28968): at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1134)
E/AndroidRuntime(28968): at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:378)
E/AndroidRuntime(28968): at com.github.ignition.location.IgnitedLocationManager.disableLocationUpdates(IgnitedLocationManager.aj:414)
E/AndroidRuntime(28968): at com.github.ignition.location.IgnitedLocationManager.ajc$before$com_github_ignition_location_IgnitedLocationManager$3$36e174d9(IgnitedLocationManager.aj:240)
E/AndroidRuntime(28968): at com.mypackage.myapp.MyActivity.onPause(MyActivity.java:79)
E/AndroidRuntime(28968): at android.app.Activity.performPause(Activity.java:5106)
E/AndroidRuntime(28968): at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1225)
E/AndroidRuntime(28968): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2825)
E/AndroidRuntime(28968): ... 12 more