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
0
votes
1 answer

Getting seconds from chronometer to an integer

I'm creating game that will increase it's level every 10 seconds, the users will see the time (using chronometer) and the level they currently at. I'm trying to create an integer that will be incremented every 10 seconds as shown on the…
0
votes
1 answer

Activity wait for transition then start timer. min sdk 16

I am using a fade_in and fade_out for my activity transition. Everything is running ok when I navigate the menus. The problem is that I have 6 buttons that start a specific activity which includes a timer(chronometer). This activity starts this…
0
votes
2 answers

How to start, stop and reset the chronometer in android?

How to set start , stop , reset in chronometer ? I'm implementing chronometer in my app. I created three buttons start, stop , reset.. start : starts timer from the 00:00. stop: completely stops timer showing the time runned. reset: resets the timer…
Amar
  • 3
  • 3
0
votes
1 answer

Is it possible to create a timer that skips a function within a loop?

In my project I'm using opencv to catch frames from a webcam and detect some things in there through some functions. The problem is that in a determinate function is not necesary to catch all the frames, it would be enough to take a frame every 0.5…
0
votes
2 answers

How can I do a CountUp timer loop?

I need a count up time to launch a task every five minutes and restart the count up to do the same task every five minutes. I have tried it making my own custom countdown timer, but I do not know how to implement the loop private static final long…
fesave
  • 181
  • 13
0
votes
0 answers

Chronometer timer does not stop

I have a chronometer timer on a fragment and I want it to reset to 00:00 and stops when I press a button. Here is the code of the fragment: public class FirstFragment extends Fragment { Chronometer chronometer; @Overried public View…
Auclown
  • 179
  • 1
  • 3
  • 20
0
votes
2 answers

How to show time in minute:second format, with minutes including the hours?

I want to show the time elapsed from a certain point in my view. I am using the Chronometer class for that. The issue is, however, that after one hour, it goes to show "1:00:00", but I want it to show 60:00 and so on (like after 80 minutes it should…
Prem Suman
  • 36
  • 1
  • 2
  • 9
0
votes
0 answers

How to calculate the current millisecond provided if there is old millisecond in java

I making a timer in my android app. I have a scenario where I dont need to stop the timer even if the app is closed. If the timer is running and user closes the app and reopen it after sometime. He should see the latest time on the timer. But…
sagar suri
  • 4,351
  • 12
  • 59
  • 122
0
votes
2 answers

ClassCastException casting chronometer.java file

I'm using Kotlin. I tried using the Millisecond Chronometer found here https://github.com/antoniom/Millisecond-Chronometer. I downloaded the zipfile, and then copied the Chronometer.java file into a new .java file in my project. I placed a…
0
votes
0 answers

Custom listview adapter with a chronometer refreshes when scrolled

I have created a custom listview adapter to fit a button, a custom chronometer and a textview. When i scroll my listview, the rows that are "hidden" refresh themselves and so chronometers, how can i keep chronometers running even if they're…
HiiiiD
  • 46
  • 1
  • 4
0
votes
1 answer

Getting the time of a Chronometer in a String?

I want to get the time of the Chronometer into a String (or is a string wrong for this kind of use?). How does it work? Chronometer mChronometer; Button button1; Button button2; @Override protected void onCreate(Bundle savedInstanceState) { …
Cyb3rKo
  • 413
  • 7
  • 22
0
votes
0 answers

Addition of Long values inconsistent results

I have developed an application that has 3 chronometers which are used like stopwatches. When the 3rd one is stopped, a total will be given which seems very simple and basic. I have 3 test devices which I am testing to ensure that the app behaves as…
TheAlmac2
  • 193
  • 2
  • 15
0
votes
0 answers

chronometer in home screen widget - wrong count down format

I have home screen widget which have one chronometer as RemoteViews item. I need this chronometer to countdown from some time in the future. Chronometer works, but I have noticed some strange time formatings on some devices. For example, if there is…
0
votes
1 answer

Chronometer widget starts from 01.00.00

when I launch my app from the emulator the Chronometer starts at 00.00.00, but when I launch it from a smartphone it starts one hour ahead (01.00.00). This is my code for starting the…
SPlus91
  • 53
  • 1
  • 7
0
votes
0 answers

How to use a chronometer and properly update variables in a fragment?

My scenario: I have three fragments in one activity, the activity switches between the fragments using a bottom menu. In the first fragment are multiple views including buttons, textViews and a chronometer. The second fragment mainly displays data…
jonasxd360
  • 1,225
  • 4
  • 19
  • 35