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

how to make android chronometer invisible and visible when clicked

I am working on app which has a titlebar with chronometer on the left and a textview centered in a RelativeLayout. RelativeLayout take height of textview and fill screen width
3
votes
2 answers

Chronometer font doesn't change in android

I want to change the font of my chronometer in android.I have set my default font to be a custom font . The font seems to be applied every where except the chronometer. I have also tried setting android:fontFamily="@font/myfont" but it didn't work.…
Hissaan Ali
  • 2,229
  • 4
  • 25
  • 51
3
votes
0 answers

How can I run stopwatch in background?

I'm working on android app where I need to start/ stop the stopwatch even when app is in background. I'm going to use single button for start/stop and 2 buttons only for starting. I'm calling startStopChronometer() method in onClickListener function…
cooldev
  • 419
  • 1
  • 4
  • 13
3
votes
2 answers

Chronometer start from specific value in Notification RemoteViews

I'm trying to start the chronometer in a new notification but from a paused(elapsed) "the elapsed time is got from another chronometer", not from zero The start base in Notification RemoteViews.class of chronometer is different from the start base…
3
votes
1 answer

Android Chronometer doesn't start

I have a view and I want to add a chronometer onto it. Then, on draw I want to display the current time. Here is how I did: public class MyView extends View { private Chronometer chrono; private long elapsedTime=0; private String…
Alin
  • 14,809
  • 40
  • 129
  • 218
3
votes
1 answer

How to create chronometer without view?

I need chronometer without view. I tried with chronometer = new Chronometer(getActivity()); chronometer.setBase(SystemClock.elapsedRealtime()); chronometer.start(); If I try to fetch chronometer value from another button…
praj
  • 849
  • 1
  • 16
  • 39
3
votes
1 answer

How to use the chronometer as a countdown timer in Android

I have defined a chronometer; protected Chronometer chrono; protected int baseTime; protected int stopTime; protected long elapsedTime; My program asks questions to the user and i want to set a timer based on the user's input. I want a timer which…
temre
  • 189
  • 1
  • 3
  • 15
3
votes
1 answer

Resume Chronometer from given minutes

I have a Chronometer and a int variable representing the accumulated minutes when it was stoped. I want to resume the chronometer from these minutes. int accumulatedMinutes = 2; chronometer.setBase(SystemClock.elapsedRealtime() +…
Héctor
  • 24,444
  • 35
  • 132
  • 243
3
votes
1 answer

How to save time that Tick in Chronometer with SharedPreferences

As we know to save something like int value's we use this SharedPreferences pref = getSharedPreferences("SavedGame", MODE_PRIVATE); SharedPreferences.Editor editor = pref.edit(); editor.putInt("Something", "Value"); editor.commit(); …
Ricci
  • 217
  • 5
  • 21
3
votes
4 answers

Chronometer: I want to make a button reset to "00.00" not restart the chronometer

I want the start button to start the time, the stop button to completely stop it at that time, and the reset button to start the clock back at "00.00". Everytime I click reset it restarts the time. I just want it to reset back to "00.00". Thanks for…
PinkNGreen
  • 43
  • 2
  • 7
3
votes
1 answer

Why isn't onChronometerTick being called?

My code never enters the onChronometerTick method. What am I doing incorrectly? Do I need to set the tick time somehow? I can't figure out a way to do that. elapsedTimer.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() { …
Adam Johns
  • 35,397
  • 25
  • 123
  • 176
3
votes
2 answers

How to make a chronometer in AndEngine?

I'm making a Race Game, and now I want to implement a clock/chronometer that shows your times. I want to show the actual time in a ChangeableText and the Best lap time in another ChangeableText. How I can update the time every second or every 0.1…
joanlopez
  • 579
  • 1
  • 6
  • 17
3
votes
0 answers

Why my app vibrates only when the usb cable is connected to the PC?

Im my app. I have to make vibrations in time intervals defined by the user. Basically it has a chronometer that makes the device vibrating when it is reached the defined time. I have two issues: 1) When the app is in backgound, the chronometer…
androidevil
  • 9,011
  • 14
  • 41
  • 79
3
votes
2 answers

Android Chronometer

How to start the chronometer with a specific time other than default 00:00? Is it possible to set chronometerObj.setBase(startTime) ? ch.setBase(SystemClock.elapsedRealtime()-anylongvalue); ch.start(); can I set start time, if I put anylongvalue?
ASP
  • 1,974
  • 3
  • 18
  • 30
2
votes
1 answer

chronometer start activity when time is reached

I want a new activity to start when a new activity is reached, so far i've been having some trouble. This is what i have so far. I hope you guys understand what i am trying to do. If there is an easier way that works please tell me. perhaps i…
1 2
3
20 21