Skip to content

Commit

Permalink
fix: App crash while navigating back from review stats page (#766)
Browse files Browse the repository at this point in the history
- Fixed a crash that occurred when pressing the back button on the Review Stats screen in low-memory scenarios.
- The issue arose because TestActivity was recreated, and while the Exam object was restored from savedInstanceState, it was not reassigned to examViewModel.
- This commit ensures the examViewModel is updated during activity recreation, preventing the crash and maintaining consistent state.
  • Loading branch information
PruthiviRaj27 authored Dec 13, 2024
1 parent 4f7c262 commit 78c5ea0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exam/src/main/java/in/testpress/exam/ui/TestActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ void onDataInitialized() {
if (exam == null) {
exam = courseContent.getRawExam();
examViewModel.setExam(exam);
} else {
examViewModel.setExam(exam);
}
if (courseAttempt == null && permission == null) {
checkPermission();
Expand Down

0 comments on commit 78c5ea0

Please sign in to comment.