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

Android Chronometer: Stops when changing View - Save state?

I've got a ActionBar via ActionBarSherlock, but when I switch from the tab of the chrono, to another. It stops and goes back to 0. When I minimize the app it doesn't stop... What do I need to save the state? I'm using 4 Button for start, stop,…
moritzg
  • 4,266
  • 3
  • 37
  • 62
0
votes
1 answer

Method call - onActivityResult vs DialogInterface.OnClickListener()

I just published a game on the Play Store and am planning to make it look better and more intuitive, si I'm trying to replace the Android dialogs by mines. When the user finish a level, I need my custom dialog to show and if the user clicks some…
Mickäel A.
  • 9,012
  • 5
  • 54
  • 71
0
votes
1 answer

Value of chronometer into string

I'm trying to multiply the value of my chronometer or just try to get the value to be a string. Every time I try to make it a string and use toast.show() to view it, my application crashes. I can get the value of my EditText to show up but I can't…
Mike
  • 1
  • 2
0
votes
2 answers

Chronometer doesn't draw when initially added to layout

I'm trying to write a simple timer app. I'm creating a counter class that extends chronometer. Anyway, when I add the custom chronometer to my layout in onCreate(), it doesn't get drawn. It only gets drawn later when I switch to another tab, and…
Andi Jay
  • 5,882
  • 13
  • 51
  • 61
-1
votes
1 answer

How do i start chronometer from specific time in string format (01:30:24)? [Android]

How to set start time in chronometer which is in string format (eg - 01:30:24)? Nb: android using Kotlin
SARATH V
  • 500
  • 1
  • 7
  • 33
-1
votes
1 answer

Using Chronometer in BottomNavigationView

I'm using Chronometer in one of the fragment of BottomNavigationView Chronometer works fine but when i select another fragment it restart from 00:00 is there anyway if i select another fragment and come back to timer_fragment and the timer show…
Rahul Bh
  • 123
  • 2
  • 15
-1
votes
1 answer

Setting Chronometer to gone visibility stops it from working

I have this code, which calls a function every second. The function perfroms numerous tasks related to the progress of a speed test. As you can see there is a line where the visibility is set to "gone". In Android 8.1.0 this causes the Chronometer…
Dan
  • 2,304
  • 6
  • 42
  • 69
-1
votes
2 answers

Cannot resolve symbol issues in making a stopwatch

(Keep in mind i'm very new to coding) I'm having an issue when coding a stopwatch app, I've scavenged this site and found no solution to my issue, comparing my code to another user's who attempted the same tutorial, i found that they are the same,…
-1
votes
1 answer

How to set and get Base property in chronometer c# newbe

Hi I am new in android and c#. I would like to implement chronometer to my app and I stuck tring to write following java code in c#. chrono.setBase(SystemClock.ElapsedRealtime()); I get information that i should set Base property like that public…
user3897367
  • 261
  • 1
  • 3
  • 11
-1
votes
1 answer

Problems continued to change. Android

I have a timer in my code. When the screen orientation is changed or when I leave the app with the back button, the timer does not retain the value. Is solved with onPause, onStop, onCreate methods .... but do not know exactly how. What solution…
-1
votes
2 answers

Showing left side zeros formating strings - Objective-C

I am trying to implement a chronometer on my app, but the left side zeros won't show up. Do you know any way to make them default? Here's what I am trying: self.text.string = [NSString stringWithFormat:@"%2.0d:%2.0d:%1.0d", minute, second,…
RickON
  • 395
  • 7
  • 18
-1
votes
1 answer

How to compare an EditText to Chronometer?

I tried in several ways and I also search a lot but what I found is very confuse to me because I'm relative begginer in Android dev. I didn't know anything about how to use the chronometer, I passed all the day studing it and I know now how to…
Murillo Ferreira
  • 1,423
  • 1
  • 16
  • 31
-2
votes
1 answer

Make a chronomter with discord.py

I want to make a chronometer with Discord.py. I started writing the script but I have problems with result I want to determine the time (in hours) between two commands. But with datetime, the strftime doesn't work. After the…
ZIKEY
  • 1
-2
votes
1 answer

Show chronometer time at different color at different time interval

In my android Apps I have used Chronometer,it works good.Now I want to view chronometer time in different color ie when chronometer is started it glow BLACK color and after 30 minutes it glow RED. How It is Possible?
Chandan
  • 1
  • 2
-3
votes
1 answer

Mimic stopwatch behaviour | Timer to be persistant if application is killed on goes to background

I am using the chronometer - but persisting chronometer within the notification - service - application was difficult for me Scenarios - Start timer on tap of the button While the app goes in the background, start the timer in the custom…
DHRUV SINGH
  • 65
  • 1
  • 5
1 2 3
20
21