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

Do not trigger fragment change when the activity was already closed #10853

Merged
merged 3 commits into from
Nov 27, 2019

Conversation

planarvoid
Copy link
Contributor

Fixes #10852

I've investigated this issue deeply but I couldn't find how it could be happening. It seems that the system gets the bottom nav click after onSaveInstanceState is called on the main activity. This shouldn't be possible. I think in this case it's safe to call commitAllowingStateLoss because we don't mind we lose the bottom nav position when the activity is being killed. It's better than crashing.

To test:

  • Smoke test the bottom navigation

PR submission checklist:

  • I have considered adding unit tests where possible.

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@planarvoid planarvoid added this to the 13.8 milestone Nov 26, 2019
@planarvoid planarvoid self-assigned this Nov 26, 2019
@peril-wordpress-mobile
Copy link

You can test the changes on this Pull Request by downloading the APK here.

Copy link
Contributor

@malinajirka malinajirka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Vojta! ;) As we discussed I'm not a big fan of "commitAllowingStateLoss", but it seems reasonable to use it for this case. 🚢

@malinajirka malinajirka merged commit 244faa2 into develop Nov 27, 2019
@malinajirka malinajirka deleted the fix/crash_in_wp_main_navigation_view branch November 27, 2019 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash in Bottom navigation: Can not perform this action after onSaveInstanceState
2 participants