Commit 6fbf354
fix: exiting whiteboard crash
calling `requireContext()` after leaving the fragment caused a crash.
Fixed by storing the value of whether the system is using gestures navigation instead of retrieving it every time.
If the user changes the gestures navigation mode while using the reviewer, the activity and fragment are recreated, so that ends up not being a problem
java.lang.IllegalStateException: Fragment ReviewerFragment{a6a61db} (47dfdd3d-a8b4-49be-ad89-2e879c2630b8) not attached to a context.
at androidx.fragment.app.Fragment.requireContext(Fragment.java:977)
at com.ichi2.anki.ui.windows.reviewer.ReviewerFragment.setupWhiteboard$lambda$1(ReviewerFragment.kt:554)
at com.ichi2.anki.ui.windows.reviewer.ReviewerFragment.setupWhiteboard$lambda$1(ReviewerFragment.kt:554)1 parent d5cfc83 commit 6fbf354
1 file changed
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
| 548 | + | |
548 | 549 | | |
549 | 550 | | |
550 | 551 | | |
551 | 552 | | |
552 | 553 | | |
553 | | - | |
554 | | - | |
| 554 | + | |
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| |||
0 commit comments