Skip to content

The app crashes when you try to navigate out of it  #526

@harshshinde07

Description

@harshshinde07

Describe the bug

The app crashes on second back press when you try to navigate away from it.

Expected Behavior

The app should successfully exit on pressing the back button second time.

Steps to reproduce it

  • Open the app
  • Try to close the app by pressing back button twice.

LogCat for the issue

java.lang.IllegalArgumentException: Receiver not registered: io.neurolab.main.NeuroLab$2@8bb47b1
        at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:1184)
        at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1448)
        at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:639)
        at io.neurolab.main.NeuroLab.onBackPressed(NeuroLab.java:274)
        at android.app.Activity.onKeyUp(Activity.java:2970)
        at android.view.KeyEvent.dispatch(KeyEvent.java:2751)
        at android.support.v4.view.KeyEventDispatcher.activitySuperDispatchKeyEventPre28(KeyEventDispatcher.java:137)
        at android.support.v4.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:87)
        at android.support.v4.app.SupportActivity.dispatchKeyEvent(ComponentActivity.java:126)
        at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:535)
        at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
        at android.support.v7.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:2533)
        at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
        at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:363)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5244)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5110)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4612)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4665)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4631)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4778)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4639)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4835)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4612)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4665)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4631)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4639)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4612)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4665)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4631)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4811)
        at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4981)
        at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2461)
        at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2024)
        at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2015)
        at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2438)
        at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:326)
        at android.os.Looper.loop(Looper.java:147)
        at android.app.ActivityThread.main(ActivityThread.java:6784)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:852)

System Information

DeviceLenovo K8 Note
Android version/OS 8.0

Would you like to work on the issue?

Yes

Metadata

Metadata

Assignees

Labels

CodeheatIssues for the Codeheat contest.bugUnexpected problem or unintended behavior in app

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions