Ben bu kodda neyin yanlış olduğunu bilmiyorum countdowntimer çalışıyorum ama 00:01 sonraki saniye için aynı kalır .. geri sayım 00:00 almıyorum. i birçok şeyi denedik ama CountDownTimer Gösterilmiyor 00:00
çalışmıyordu CDTimer ++>public class CDTimer extends CountDownTimer {
public CDTimer(long startTime, long interval) {
super(startTime, interval);
}
@Override
public void onTick(long millisUntilFinished) {
String zero = tv.getText().toString();
if(millisUntilFinished < 1950){
tv.setText("00:00");
}
long seconds = (millisUntilFinished/1000);
long minutes = seconds/60;
seconds = seconds % 60;
tv.setText(String.format("%02d", minutes)
+ ":" + String.format("%02d", seconds));
Log.d("Time", String.valueOf(timeRemain));
timeRemain = millisUntilFinished;
}
@Override
public void onFinish() {
if (isWarmup) {
isLow = true;
isWarmup = false;
isHigh = false;
startTime = getSec() * 1000 + 1000 ;
disp_txt.setText("Low Interval");
cd = new CDTimer(startTime, interval);
cd.start();
} else if (isLow) {
isLow = false;
isWarmup = false;
isHigh = true;
startTime = getSec() * 1000 + 1000;
disp_txt.setText("High Interval");
cd = new CDTimer(startTime, interval);
cd.start();
} else if (isHigh) {
isLow = false;
isWarmup = true;
isHigh = false;
disp_txt.setText("Completed");
tv.setText("00:00");
start.setText("START AGAIN");
btn_chk = 0;
cd.cancel();
}
}
}
timeSec() yöntemi ++>
private int getSec()
{
if (isWarmup)
return warmup;
else if (isLow)
return lowint;
else
return highint;
}
için counDownInterval değiştirmek deneyin görebiliyordu daha hızlı gider? – Opiatefuchs
startTime = timeSec() * 1000 + 1000 ve aralık = 1000 – Rohit
ve timeSec değeri nedir? – Opiatefuchs