Data is lost when navigating through fragments v2 (FOR SPRING 2022 SEMESTER)
License and Copyright Notice
By submitting this issue or commenting on this issue, or contributing any content to this issue, you certify under the Developer Certificate of Origin that the content you post may be licensed under GPLv3 (for code) or CC-BY-SA 4.0 International (for non-code content).
Summary
When pressing back when you are in a guest registration fragment, then go forward again, the data that the guest enters is lost and the guest has to reenter their data.
Steps to reproduce
- Enter information on a fragment.
- After adding valid information, go to the next fragment by pressing next.
- Enter information on the fragment after.
- Press back on the emulator.
- A toast warning will pop up. Press "YES, I'M SURE"
- You will go back to the previous fragment. The data should be there.
- But go to the next fragment, the data in the next fragment should be gone.
What is the current bug behavior?
The data gets lost and gets set to empty or default.
What is the expected correct behavior?
The data should be preserved when going back and forth through fragments
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as it's very hard to read otherwise.)
Possible fixes
- Research ViewModels
- Use SavedInstanceState (this method may not work, it was already attempted)
- Other solutions may be needed
Labels
(We have not finalized our list of labels, for now, include the labels you would like to include as a comment.