medic / cht-android

A native Android container for Community Health Toolkit (CHT) applications
GNU Affero General Public License v3.0
25 stars 49 forks source link

fix(#338): Refactor OpenSettingsDialogFragment class to have a empty constructor #366

Closed sugat009 closed 2 months ago

sugat009 commented 2 months ago

Fixes: #338

Refactored the OpenSettingsDialogFragment class to have an empty constructor. According to the Android documentation, every Fragment class should have an empty constructor that does nothing and is not a non-empty constructor. [Reference](https://developer.android.com/reference/android/app/Fragment.html#Fragment()). Not doing this leads to the Android ecosystem being unable to restore the Fragment's state when re-instantiated causing the issue mentioned in the linked issue.

Testing: For e2e testing, you can start using the app normally and ensure that it does not crash and to test the functionality that the OpenSettingsDialogFragment class provides, you can tap the screen 5 times and then, right-swipe the screen with 2 fingers.