fix that it goes to endscreen at end

This commit is contained in:
2024-06-07 14:48:13 +02:00
parent 2fce84bf43
commit dd37b52e83

View File

@@ -183,16 +183,13 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
return false;
});
if (EXERCISE_REP == 10) {
Intent intent = new Intent(FitnessActivity.this, EndScreenActivity.class);
startActivity(intent);
finish();
}
videoView.setOnCompletionListener(mp -> {
if (EXERCISE_VIDEO_REPETITION < ExerciseManager.DEFAULT_EXERCISE_REPETITIONS) {
videoView.start(); // start the video again
EXERCISE_VIDEO_REPETITION++;
if (progress >= 10) {
runOnUiThread(() -> NavigationManager.navigateToActivity(this, EndScreenActivity.class));
}
}
});
});