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
0
votes
1 answer
Chronometer & Fragment, Restore State after rotation
I have tried the Android: How to restore the state of a stopped chronometer after rotation? and Fragments restore state on orientation changed but they do not apply to me because they either do not work or I am using fragments.
Also it appears that…

Elliot Huffman
- 172
- 3
- 18
0
votes
0 answers
Don't stop chronometer while using another app
For example: in the App I have a Chronometer, I click on play to start it and when it arrives at 00:00:10 I receive a call. I stay talking for 30 seconds before returning to mi app. I would find the timer paused still displaying 00:00:10, but I'd…

Kevtho
- 193
- 1
- 9
0
votes
1 answer
Overriding Android Chronometer class
I want to override the android chronometer class. I want it to inflate a custom XML layout and to also have a quicker update interval.
I've found one that modifies the update interval from the default 1s to 0.1s on github.
But I want to do more…

nebuchadnezzar I
- 125
- 1
- 12
0
votes
0 answers
Sensor Thread and Handler Thread Problems
I'm working on an app for a Sony Smarthwatch 3.
It records audio and sensor values after a command from another device that is connected by Bluetooth.
I try to be more clear.
The problems
The Handler doesn't update the associated TextView (also…

F. Petrulio
- 95
- 2
- 9
0
votes
0 answers
How To compare A value from Android Chronometer while running
I have a chronometer started counting in seconds in a LongPress on an ImageView. I want to show a message in a TextView if the Chronometer is equal to 10 seconds while running.
This is my code :
private View.OnLongClickListener speakHoldListener =…

Ysen Eycen
- 1
- 5
0
votes
1 answer
Unable to instantiate Chronometer object inside Activity
I have an activity that implements chronometer inside the Notification in my notification there is a button to stop the chronometer.The click event for button is working successfully but when i call method stopButtonClick() to stop chronometer but…

sai pavan
- 1
- 4
0
votes
1 answer
How to make chronometer run when switched between activities
I have chronometer that only works if we are present in that particular activity now if i want to switch to other activity keeping the chronometer working continuously what must be done here is my code till now what i have implemented.
Thanks In…

sai pavan
- 1
- 4
0
votes
1 answer
Can Android Chronometer show 90 minutes as 90:00 NOT 1:30:00
I am developing an Android Application that displays a android.widget.Chronometer timer.
As this is a sports related application I need the timer to show 90 minutes as 90:00 and NOT 01:30:00.
Is my only option to create a custom Chronometer?

Hector
- 4,016
- 21
- 112
- 211
0
votes
1 answer
Pause and resume chronometer in notification compat
I have a notification build with chronometer enabled. I also have notification actions which pauses and resumes my task along with the chronometer obviously. But I cannot make the chronometer pickup from the earlier elapsed time. My time calculation…

Vijai
- 1,067
- 2
- 11
- 25
0
votes
1 answer
How I can get medial player Duration and stop Chronometer?
I am making a android simple media player for playing a audio files and facing a problem with it.
I want to stop Chronometer and media player
When the current Duration of playing file == total duration of file..?
Here is my demo code.
…

sunny
- 179
- 2
- 14
0
votes
1 answer
How to save time from the chronometer and access it from another activity
The goal is to save the time shown on the Chronometer. I want to press stop and have the value stored in a variable so I can call it in another activity.
So far I can store the time on the Chronometer to a variable with the function showTime, the…

thenry
- 85
- 1
- 12
0
votes
1 answer
Android Studio chronometer time through different activities
I am trying to get chronometer to maintain its time throughout different activities. I have the chronometer in a fragment that I have at the bottom of each activity. So basically once it switches from MainActivity to Corsi I want the clock to be the…

Wongesse
- 112
- 1
- 2
- 8
0
votes
0 answers
Choronometer to save elapsed time and display in the ListView in android
I have a choronometer in my app. Its working fine but i am unable to save the recorded time. Every time the user clicks on the stop button i want to capture the time and save it in the database and display it to the user in a ListView with all the…

Khadija Daruwala
- 1,185
- 3
- 25
- 54
0
votes
2 answers
Chronometer stopwatch: Time keeps increasing in background when stop is pushed
When I press the stop button it stops the time from being viewed but still increments in the background. When I press start it shows the entire time that it was stopped. Does anyone know how to make stop actually stop?
import…

user2980816
- 61
- 1
- 1
- 4
0
votes
3 answers
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener
I am new to android and i am trying to make a stopwatch but dont know whats wrong with my code. I am getting this error-
java.lang.NullPointerException: Attempt to invoke…

Khadija Daruwala
- 1,185
- 3
- 25
- 54