Kristy Welsh
Kristy Welsh

Reputation: 8530

Need a CountdownTimer that is Accurate and can be Paused android

I have a countdown timer that counts down from 60 to 0 seconds. I've been having fun (not!) trying to get CountDownTimer to work with a pause and be accurate as far as the Timing.

android CountDownTimer - additional milliseconds delay between ticks

The above link fixes the inaccuracies somewhat, but display sometimes starts at 60 seconds and sometimes at 59 seconds.

In addition, I need to be able to pause the timer. I tried using this implementation for pause, but this implementation was based on Android's CountDownTimer and has the inaccuracies discussed in the first link:

http://www.java2s.com/Open-Source/Android/Timer/multitimer-android/com/cycleindex/multitimer/CountDownTimerWithPause.java.htm

Anyone have any ideas on how to implement a CountDownTimer with pause that is accurate?

Upvotes: 3

Views: 1496

Answers (1)

Just take a look at the answer from Sam here, is the most accurate I've found!

Upvotes: 1

Related Questions