In Android, Chronometer is a class that implements a simple timer. Chronometer is a subclass of TextView. This class helps us to add a timer in our app. You can give Timer start time in the elapsedRealTime() timebase and it start counting from that. If we don’t give base time then it will use the time at which time we call start() method. By default a chronometer displays the current timer value in the form of MM:SS or H:MM:SS.
Questions tagged [chronometer]
302 questions
51
votes
7 answers
Android - Get time of chronometer widget
How to get the time from a Chronometer? I tried getText, getFormat, getBase, etc, but none of them could work.
Example code snippet:
Chronometer t = (Chronometer)findViewById(R.id.toptime);
long time =…

Isaac Waller
- 32,709
- 29
- 96
- 107
44
votes
3 answers
Android_Chronometer pause
I want to pause chronometer and after I click the button I want to continue chromoneter to count... I search but couldn't a function related this.. how can do it?

andveand
- 471
- 2
- 6
- 8
18
votes
1 answer
Chronometer reset
I am trying to completely restart Chronometer and its does not work. Instead it is being paused. Basically what I am trying to do is to do something while chronometer is counting till 10. After its done we prompt the user to try again. In which case…

dropsOfJupiter
- 6,763
- 12
- 47
- 59
16
votes
7 answers
Show milliseconds with Android Chronometer
I'm looking for a way to make the Chronometer in Android (preferably 1.6 and upwards) show 10ths of a second while counting up.
Is it possible to do this? If not, is there a free (and preferably open source) library that does the same? Failing that…

Matthew Steeples
- 7,858
- 4
- 34
- 49
14
votes
2 answers
Chronometer doesn't update in app widget ListView
I have an app widget displaying timers. Timers can be started, stopped or resumed.
On Android 8 timers don't tick sometimes (50/50). Some users complained about the issue on Android 7 but I'm not absolutely sure if it's the same issue. Everything…

zaplitny
- 416
- 4
- 19
13
votes
1 answer
Creating a chronometer in Android
I'd like to know how can I implement in Android a simple chronometer with a start and stop button that displays data in the HH:MM:SS:MsMs format... I've been searching and searching and I have found some classes on google developer, but they didn't…

user1123530
- 561
- 3
- 7
- 17
12
votes
3 answers
How do I start chronometer with a specific starting time?
Let's say I have this variable:
long myMillis = 20000;
This means that I want my Chronometer to start at exactly 20 seconds (00:20).
I tried doing this:
chronometer.setBase(myMillis);
But it doesn't work. It dosn't start with 20 seconds. It starts…

Guy
- 6,414
- 19
- 66
- 136
11
votes
2 answers
How to set Android Chronometer base time from Date object?
I've got an issue with starting chronometer from the specific time.
There is a Date object I want my chronometer start from:
Date d = new Date(); //now, just for example
chronometer.setBase(d.getTime()); //long value of d
Log.d("Date: " ,…

Vitalliuss
- 1,614
- 1
- 12
- 10
9
votes
4 answers
Check if Chronometer is running
chronometer in android how to check whether chronometer is running or stop?
if start then i want to stop it and if not running then start chronometer.

Megha
- 1,581
- 2
- 18
- 33
9
votes
2 answers
How to Start Chronometer from 00:00
When I click on the Image Button(that should start the Chronometer ) the Chronometer doesnt start from 00:00 , but from the time the app is running .
For example if I open the app and wait 10 sec , when I'll click on the Imageutton then the …

liav bahar
- 237
- 3
- 7
- 13
9
votes
7 answers
Android: chronometer as a persistent stopwatch. How to set starting time? What is Chronometer "Base"?
I do have one service running in the background. Whenever it starts I store in memory the starting time in milliseconds:
startingTime = new Date().getTime();
I want to display a chronometer that starts counting when the service starts and never…

Santiago
- 1,575
- 2
- 12
- 11
7
votes
4 answers
chronometer doesn't stop in android
In my app I want to show a stop timer watch. When I searched through Google I found an option called Chronometer in the developers site. It look's just like a stop timer watch.
When I click the start button I want the timer to get started and when I…

Siva K
- 4,968
- 14
- 82
- 161
7
votes
2 answers
Support Library for Chronometer in Android
If there any support Library function that could make the setCountDown function of the chronometer support by APIs lower than 24?

Wali Muhammad Khubaib
- 125
- 1
- 13
7
votes
4 answers
Android Chronometer resume function
I mm trying to create a resume button in my Android app using Chronometer. So far I have this code snippet for the resume method:
private long pauseResume() {
long timeWhenStopped = chronometer.getBase() - SystemClock.elapsedRealtime();
…

banana
- 171
- 1
- 6
- 14
6
votes
5 answers
Android Chronometer, retain time state (and keep counting in background)
I have a timer that counts up from the time a user encounters that activity
I am currently using a Chronometer set during onCreate (initially started only when certain conditions are met). But I need the chronometer to keep counting upward until the…

CQM
- 42,592
- 75
- 224
- 366