Skip to content

Resolve "In the Guest Registration page which has all those drop down menu provided for the user to select, the app crashes after rotating the page."

Anthony D requested to merge 452-guest-reg-rotational-crash into main

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).

Branch Name

452-guest-reg-rotational-crash

Related Issues

Closes #452 (closed)

Description

This merge request successfully closes Issue 452 AND an additional issue via the following:

  • Resolves issue where the application would crash on activity state / orientation changes due to a NullPointerException.
  • Resolves issue where the application's user-selected language choice was not persistent / saved between fragments on activity state / orientation changes.
  • Institutes several null-checks to avoid potential future NullPointerExceptions.
  • Resets user-selected language choice when the Home button is pressed.
  • Language selection is also redundantly saved in save/restore instance state methods, as a potential fallback if the shared preferences fail.
  • Adds appropriate comments and documentation to affected elements of the code.
  • Deprecated code has been commented out.

Steps to Test

(List the steps needed to test this merge request here using bullets, for ex:)

  1. Open the application.
  2. Select "Guest Registration" from the Home page.
  3. Select the "Select Language" button and choose a language. For visual results, select "Español."
  4. Fill out the first form.
  5. Rotate the device and wait for the application to rotate. If it does not rotate, ensure that device rotation is enabled.
  6. If successful, you will notice that the language is the same and the app will not crash.
  7. Proceed to the next fragment by clicking the "Next" or "Siguiente" button.
  8. Fill out some information.
  9. Rotate the device and wait for the application to rotate. If it does not rotate, ensure that device rotation is enabled.
  10. If successful, you will notice that the language is the same and the app will not crash.
  11. For thoroughness, proceed to the next fragments and repeat steps 7-9.

Relevant Screenshots

(Post any relevant screenshots here.)

Relevant Logs

(Paste any relevant logs here.)

Developer Notes

-Standard instance state bundle saving / retrieval methods did not work, so this solution makes use of the SharedPreferences class. -Resolving this issue opens up a new issue, involving saving user data between activity state / orientation changes. See TODO in GuestDatabaseRegistrationActivity.java (Will create new Issue).

Edited by Anthony D

Merge request reports