Android has view Chronometer
, which automatically boots when it enters ativity .
To restart the timer from 0
I use the following code:
chronometer.setBase(SystemClock.elapsedRealtime());
chronometer.start();
When I use stop()
, it stops visually from timing, but when it is pressed again the start()
is as if it had not stopped the timer because it was actually working in the background.
How do I pause chronometer
and continue from where did it stop?