private void doCountdown(int duration) {
// 카운트다운 타이머 설정
countDownTimer = new CountDownTimer(duration * 1000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
int secondsRemaining = (int) (millisUntilFinished / 1000);
int minute = (int)Math.floor(secondsRemaining / 60);
int second = secondsRemaining % 60;
String formattedTime = String.format("%01d:%02d", minute, second);
countdownTextView.setText(formattedTime);
}
@Override
public void onFinish() {
}
};
countDownTimer.start(); // 카운트다운 시작
}