Questions tagged [chronometer]

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.

302 questions
2
votes
1 answer

Android Chronometer starts and stops but carries on counting when stopped

I've created an app that has a toggle button to start and stop a Chronometer, like a stop watch. When you first press the toggle button (executes .start()), the chronometer will start counting, when you then press the button again (executes…
Paul Alexander
  • 2,686
  • 4
  • 33
  • 69
2
votes
0 answers

Chronometer formatting to always show hours

So I've been trying to set the chronometer's format to "HH:MM:SS" but I haven't been able to. Tried just doing this chrono.setText("00:00:00") but when you start it, goes back to 00:00. Also tried this ` chronoM.setOnChronometerTickListener(new…
user3842769
  • 95
  • 1
  • 2
  • 10
2
votes
1 answer

Chronometer inside Service

I have a following chronometer implementation. I'd like to use it inside Service then sent its output to my fragment. The problem is that Service has no findViewById() because obviously it has no View at all. Is there any way I can get the…
XorOrNor
  • 8,868
  • 12
  • 48
  • 81
2
votes
1 answer

Doing a chrono for an iOS app

Im just new in this of programming APPs and I have just started into the world of iOS. I am trying to learn by myself, just following a course I have found on the net (CS193P - Stanford). The question is simple, I think. I would like to implement a…
Thorba
  • 181
  • 1
  • 11
2
votes
3 answers

iOS view similar to Chronometer on Android

On Android there exists a standard view called Chronometer details here. Does iOS have a similar view or a library that does something similar?
ademar111190
  • 14,215
  • 14
  • 85
  • 114
2
votes
5 answers

chronometer resume?

when I clicked start, the 'stopwatch' started to count.. I pressed pause, only the textview paused, it's not resuming, because it still running in background.. I need it to be resumed at where I've stopped.. here's my dot java code : package…
peace
  • 53
  • 1
  • 2
  • 7
2
votes
0 answers

Getting the value of chronometer as displayed in View

I'm using chronometer to display the time in my android application. i want to get the chronometer value that is displayed in the screen. i tried to use int stoppedMilliseconds = 0; String chronoText = chronometer.getText().toString(); …
sara brown
  • 1,057
  • 8
  • 29
  • 46
1
vote
2 answers

Chronometer countdown in android

I have implemented a simple chronometer from the android api demo. Now is it possible to show the countdown in chronometer like setting the start to 01:23 then onClick of start button, it will change to 01:22 then 01:21 and so on... till 00:00.…
Sameer Z.
  • 3,265
  • 9
  • 48
  • 72
1
vote
1 answer

if statement using onchronometerticklistener

I'm trying to create some time based events using a chronometer. The code below is successfully displaying a toast after 5 seconds of chronometer being started however I need the toast to be displayed at 5/10/20 seconds. I've tried using if…
Rob
  • 1,479
  • 5
  • 18
  • 24
1
vote
1 answer

Android: Chronometer with Milliseconds?

What I want is to measure time with milliseconds, but using Chronometer has the problem that it has no accuracy (its most resolution is seconds) I've seen this: Show miliseconds with Android Chronometer But I haven't been able to make it work. Maybe…
ArcDare
  • 3,106
  • 4
  • 27
  • 38
1
vote
0 answers

Change format of the value of chronometer in RemoteView

I'm developing a widget in Android, and I need a time ago field with just minutes. So, I don't like to make a Workmanager and update this field by partially updating each minute. So, I found a solution to use a chronometer, but unfortunately I can't…
M.SH
  • 357
  • 2
  • 8
  • 22
1
vote
1 answer

How to create a accurate chronometer, matching real time?

I'm working in an educational software, mostly developed using Flash AS3, and we have a chronometer which shows different values through different users. Example: Two users starting the chronometer at same time, but along some minutes of usage,…
Marcelo Assis
  • 5,136
  • 3
  • 33
  • 54
1
vote
1 answer

Android: Synchronize Chronometer with MediaPlayer

I'm using SeekBar in my application and when user seeks it should reset teh chronometer apporpriately. I wrote the code as below. chronometer.setBase(SystemClock.elapsedRealtime()); chronometer.setBase((mediaPlayer.getCurrentPosition())); but it…
Jay Mayu
  • 17,023
  • 32
  • 114
  • 148
1
vote
1 answer

One Chronometer for all Activities

I am making a simple app where there is the main activity which has buttons that lead to new activities. These activities all have the same bottom sheet with a stopwatch. I want to be able to start the stopwatch in one activity, go to main activity…
Kasanderh
  • 25
  • 4
1
vote
0 answers

android studio get time from chronometer and write to xml

I am working on an Android app using android studio. I want that if the user stops the chronometer, the chronometer will be reset, save the time and print it in XML format (text view). How can I do this? I am new to the Android studio. I hope I…