I have implemented a 10-1 secs countdown timer in my application.I have declared it globally and instantiated in the onCreate function. the code that i have implemented is :
timer = new CountDownTimer(10000, 1000) {
public void onTick(long millisUntilFinished) {
mcountdownText.setText("Time Remaining: " + millisUntilFinished / 1000);
}
public void onFinish() {
// my code.....
}
}.start();
There is one small problem, when i run my application, i don't know why there are some cases where the countdown timer runs like 10,8,7,6,5,4,3,2,1 (here it skips 9)and sometimes it works proper from 9,8,7,6,5,4,3,2,1 secs. If anyone could help me solve this error, it would be great. Thanks.