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
1
vote
0 answers

Using Multiple Chronometers in one Activity

I am trying to use multiple chronometers in one activity but the behavior of each of them is not as expected. I've expected that I would be able to start each timer simultaneously and I have declared different functions for each and different…
Aaron
  • 47
  • 11
1
vote
1 answer

Using chronometer in Xamarin

as the title said i'm using the chronometer with Xamarin, but here is my problem : it's impossible to set the chronometer to 00:00. I tried the method to set the base to 0 but it didn't work. Here is my code : Chronometer chrono =…
UnGrosTas
  • 33
  • 3
1
vote
2 answers

R.layout.chronometer cannot be resolved or is not a field- android error

I tried simple stopwatch program from http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ChronometerDemo.html. The following error is coming "R.layout.chronometer cannot be resolved or is not a field" I don't…
ezhil
  • 2,606
  • 7
  • 26
  • 30
1
vote
2 answers

How to make a method similar to on / off button using if-else

I try to put the control of the chronometer on the button, for start and stop. Tried to implement it, but the result is not the same, help with the advice? public void onStartClick(View view){ …
1
vote
1 answer

Android: Chronometer in ListView Row?

I got a row xml for my ListView with chronometer
sigrlami
  • 1,822
  • 1
  • 17
  • 35
1
vote
1 answer

How can I schedule an sqlite query to be run after a timer finishes?

I'm trying to make an sqlite query run after a timer finishes every time, e.g every 24 hours I want to insert some data into the database?
Django
  • 135
  • 1
  • 2
  • 16
1
vote
1 answer

How to parse values from chronometer (android)?

I am currently trying to create an android application for which I need the time elapsed in seconds since clicking the start button until clicking the stop button. Currently I have a timer which uses the following code in the java class: //on start…
Maja
  • 59
  • 1
  • 11
1
vote
1 answer

How do I get Chronometer to work as a countdown timer in Android?

I am making an app in android studio, and I want to be able to display the amount of time left until a certain time in the day. For some reason I can't seem to get my code to work; when I run my code does anyone know what I am doing…
1
vote
1 answer

Android Chronometer counting backward

I'm new to Android development and currently trying to implement a very simple countdown timer, which shall keep on counting after reaching 00:00, but having the text color in red when below 00:00. I have two problems: 1) It starts counting from one…
Gugger
  • 21
  • 4
1
vote
0 answers

SystemClock.elapsedRealtimeNanos() Not Working

I was use chronometer to make a Stopwatch with this code public class ChronoExample extends Activity { Chronometer mChronometer; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
Ricci
  • 217
  • 5
  • 21
1
vote
0 answers

Chronometer in RecyclerView : Timer became 00:00:00 when scrolling

I following this 1 ,2 an this 3 . I have an RecyclerView with CardView. I have add an timer using Chronometer. The aplication work like this: There is first condition of CardView with Green Color. When User choose one, the color of change into…
MrX
  • 953
  • 2
  • 16
  • 42
1
vote
0 answers

How to set total playtime of file in Chronometer meter in android

Hello everyone in facing a problem in setting the total playtime of a mp3 media file in Chronometer. Please help me how i can set it . im getting the time from media player like : mediaPlayer.getDuration() return audio play time in…
1
vote
1 answer

I am trying to implement a Chronometer with OnChronometerTickListener

I basically want a stopwatch activity in my app that will vibrate the device after 30 seconds have elapsed and sound a notification alert at 60 seconds. I am new to app development so please don't hound me for missing an obvious answer. I know I…
1
vote
2 answers

Android Timer/Stopwatch with custom UI and satisfactory performance

I have been trying to create a custom stopwatch that counts up in android. It needs to be fairly accurate down to 0.1s and with custom layout and images for the digits example: DIGITS. It also needs to be able to run in the background after the app…
1
vote
1 answer

Chronometer keep in background time spent

i would developing a feature in my app that when click on button on my activity launch a service that start,pause and resume a Chronometer. But I have a problem how start and stop in my background service. I created my Activity public class…
LorenzoBerti
  • 6,704
  • 8
  • 47
  • 89