UniRegensburg / unsere-app-fur-die-universitat-regensburg-bib-buddy

Bib Buddy - deine App für eine konzentrierte, offene Literaturarbeit!
0 stars 0 forks source link

Fixes problems with back button (see Issue #140, #123) #153

Closed SarahKurek closed 3 years ago

SarahKurek commented 3 years ago

Description Closes #140. Back button is only overwritten where necessary, e.g to save the note or to unselect items. Remove is called after closeFragment.

Affects onBackPressed methods in the fragments

Notes for Reviewer Please review & comment/approve. Thanks!

claudia3 commented 3 years ago

Error Message when using back button until home is opened and then use back buttons again the app crashes:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: de.bibbuddy, PID: 10368
    java.lang.IllegalStateException: Fragment BookFragment{f8a4bfe} (736a0239-81ee-42c0-8b90-3075f0dc196c)} not associated with a fragment manager.
        at androidx.fragment.app.Fragment.getParentFragmentManager(Fragment.java:1038)
        at de.bibbuddy.BookFragment.closeFragment(BookFragment.java:168)
        at de.bibbuddy.BookFragment$2.handleOnBackPressed(BookFragment.java:110)
        at androidx.activity.OnBackPressedDispatcher.onBackPressed(OnBackPressedDispatcher.java:192)
        at androidx.activity.ComponentActivity.onBackPressed(ComponentActivity.java:539)
        at android.app.Activity.onKeyUp(Activity.java:3784)
        at android.view.KeyEvent.dispatch(KeyEvent.java:2866)
        at android.app.Activity.dispatchKeyEvent(Activity.java:4090)
        at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:122)
        at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84)
        at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140)
        at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:569)
        at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
        at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3054)
        at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
        at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:390)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5947)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5815)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5310)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5367)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5333)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5485)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5341)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5542)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5314)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5367)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5333)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5341)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5314)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5367)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5333)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5518)
        at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:5676)
        at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3179)
        at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2721)
        at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2712)
        at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3156)
        at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:143)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:335)
        at android.os.Looper.loop(Looper.java:183)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I/Process: Sending signal. PID: 10368 SIG: 9
SarahKurek commented 3 years ago

The back button can only be tested on the smartphone, since the debbuger causes problems in interaction with the emulator.

claudia3 commented 3 years ago

The app still crashes

E/InputEventSender: Exception dispatching finished signal.
E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
E/MessageQueue-JNI: java.lang.IllegalStateException: Fragment NotesFragment{c97ba9b} (f61d16e1-c7b4-462d-946c-3e5fe337d56c)} not associated with a fragment manager.
        at androidx.fragment.app.Fragment.getParentFragmentManager(Fragment.java:1038)
        at de.bibbuddy.NotesFragment.closeFragment(NotesFragment.java:77)
        at de.bibbuddy.NotesFragment.access$100(NotesFragment.java:29)
        at de.bibbuddy.NotesFragment$1.handleOnBackPressed(NotesFragment.java:47)
        at androidx.activity.OnBackPressedDispatcher.onBackPressed(OnBackPressedDispatcher.java:192)
        at androidx.activity.ComponentActivity.onBackPressed(ComponentActivity.java:539)
        at android.app.Activity.onKeyUp(Activity.java:3169)
        at android.view.KeyEvent.dispatch(KeyEvent.java:3383)
        at android.app.Activity.dispatchKeyEvent(Activity.java:3452)
        at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:122)
        at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84)
        at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140)
        at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:569)
        at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
        at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3054)
        at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
        at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:563)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6050)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5905)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5358)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5411)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5377)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5536)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5385)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5593)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5358)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5411)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5377)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5385)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5358)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5411)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5377)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5569)
        at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:5738)
        at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3407)
        at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2854)
        at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2845)
        at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3384)
        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:181)
        at android.app.ActivityThread.main(ActivityThread.java:7050)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: de.bibbuddy, PID: 21813
    java.lang.IllegalStateException: Fragment NotesFragment{c97ba9b} (f61d16e1-c7b4-462d-946c-3e5fe337d56c)} not associated with a fragment manager.
        at androidx.fragment.app.Fragment.getParentFragmentManager(Fragment.java:1038)
        at de.bibbuddy.NotesFragment.closeFragment(NotesFragment.java:77)
        at de.bibbuddy.NotesFragment.access$100(NotesFragment.java:29)
        at de.bibbuddy.NotesFragment$1.handleOnBackPressed(NotesFragment.java:47)
        at androidx.activity.OnBackPressedDispatcher.onBackPressed(OnBackPressedDispatcher.java:192)
        at androidx.activity.ComponentActivity.onBackPressed(ComponentActivity.java:539)
        at android.app.Activity.onKeyUp(Activity.java:3169)
        at android.view.KeyEvent.dispatch(KeyEvent.java:3383)
        at android.app.Activity.dispatchKeyEvent(Activity.java:3452)
        at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:122)
        at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84)
        at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140)
        at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:569)
        at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
        at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3054)
        at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
        at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:563)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6050)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5905)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5358)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5411)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5377)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5536)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5385)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5593)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5358)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5411)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5377)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5385)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5358)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5411)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5377)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5569)
        at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:5738)
        at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3407)
        at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2854)
        at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2845)
        at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3384)
        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:181)
        at android.app.ActivityThread.main(ActivityThread.java:7050)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
I/Process: Sending signal. PID: 21813 SIG: 9