You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BaseAddFoodActivity: pop-up menu, returned to starting position by selecting the first entry.
Before and after double screen rotation
Before and after double screen rotation
BaseStatisticActivity: lost the calendar fragment.
Before and after double screen rotation
MainActivity: lost selected date and various properties changed.
Before and after double screen rotation
A data loss problem occurs when data is accidentally deleted or state variables are accidentally assigned with default or initial values. This issue is related to the activity's lifecycle (1). When a screen rotation occurs, the activity is destroyed and resumed. Data loss will happen if the developer does not save the variables before the destruction and restore them after creation. To avoid this, the developers have to implement both the logic necessary to save the activity state in the onSaveInstanceState() callback method and the logic to resume its state in the onRestoreInstanceState() callback method.
Another way to avoid data loss problems is to use the view model, designed to store and manage UI-related data in a lifecycle-conscious way (2).
Note:
Double screen rotation: It is executed twice to reach a state that should be exactly the same as the screen before if no data loss occurred.
A data loss problem occurs when data is accidentally deleted or state variables are accidentally assigned with default or initial values.
Hi, this issue has a relation with #93.
We found failures similar in the activities:
A data loss problem occurs when data is accidentally deleted or state variables are accidentally assigned with default or initial values. This issue is related to the activity's lifecycle (1). When a screen rotation occurs, the activity is destroyed and resumed. Data loss will happen if the developer does not save the variables before the destruction and restore them after creation. To avoid this, the developers have to implement both the logic necessary to save the activity state in the onSaveInstanceState() callback method and the logic to resume its state in the onRestoreInstanceState() callback method.
Another way to avoid data loss problems is to use the view model, designed to store and manage UI-related data in a lifecycle-conscious way (2).
Note:
The text was updated successfully, but these errors were encountered: