fix for losing data during rotation of device #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello again Knirirr
I was using the BeeCount app and I noticed another activity that can lead to data loss. When the user goes to edit the count settings for an item as can be seen here: https://ibb.co/N2LHbNJ
If the screen focus goes to another app or activity(for example if an incoming call forces the user to go into the phone app), or if the user rotates the phone and changes the app to landscape mode, the user will lose any data they had put into this page as can be seen here: https://ibb.co/C09QQCf
I have used savedInstanceState to automatically save the data in such cases and restore the data when the user returns to the BeeCount app(and hence the activity) or after the phone is rotated. Therefore, the user does not have to fill in the data again thus improving the user experience.
I have tested out the feature to ensure it works.
If you have any questions or if you would like me to change anything, please do not hesitate to let me know!
Thank you for your time,
Tim