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.

chronometer
Filter by
Sorted by
Tagged with
0 votes
1 answer
167 views

Resume chronometer after back pressed [closed]

In my android project i have an activity A which contains chronometer and a button to start it, a button to stop it, a button to pause it and everything is working fine. Now the problem is when i ...
ravi raghav's user avatar
-2 votes
1 answer
229 views

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 ...
Chandan's user avatar
0 votes
1 answer
89 views

Controlling margins of Android Chronometer

I have a layout with a Chronometer between 2 TextView: <TextView android:id="@+id/feed_current" android:layout_width="wrap_content" android:layout_height="wrap_content" android:...
ademarizu's user avatar
  • 865
0 votes
0 answers
120 views

background overlaps my chronometer

I put in a stopwatch png, and I am trying to design it right now but when I place the chronometer I cant see it overtop the image. Color isn't the issue so it isn't blending in. I tried making the ...
BadCoder's user avatar
  • 141
0 votes
1 answer
1k views

Restart Chronometer on Button Click After Resetting

This is how i start the chronometer: btnCount.setEnabled(true); if (!mIsStarted) { chrono.setBase(SystemClock.elapsedRealtime()); chrono.start(); ...
Andrew Caprario's user avatar
0 votes
1 answer
931 views

chronometer start on initial button click

All of my code works fine no errors, button click increases textview by 1 every click and starts the chronometer. public class MainActivity extends Activity{ TextView txtCount; Button ...
Andrew Caprario's user avatar
2 votes
1 answer
2k views

Text style on chronometer on android

How do I change the font ans font size on chronometer. When I align the chronometer with a textview it shows different size and settings. I also tried assigning font settings from textview. ...
pats's user avatar
  • 1,281
10 votes
2 answers
8k views

How to Start Chronometer from 00:00

When I click on the Image Button(that should start the Chronometer ) the Chronometer doesnt start from 00:00 , but from the time the app is running . For example if I open the app and wait 10 sec , ...
liav bahar's user avatar
3 votes
1 answer
344 views

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....
Ricci's user avatar
  • 217
0 votes
2 answers
870 views

Time Control in Android Studio [closed]

I have some problems with the order of method in my app. How i can take the control of time in an Android app? How i can know how many time is elapsed from the start of app? For more accuracy, I would ...
LolloAAA's user avatar
  • 112
1 vote
4 answers
3k views

Android Chronometer - Save time

I´m using a Chronometer in my Android App. I can start it, stop it and continue counting after pushing the start button again: @Override public View onCreateView(LayoutInflater inflater, ...
Snowman's user avatar
  • 179
0 votes
0 answers
232 views

Adding a chronometer to a JLabel

I am struggling with getting a chronometer into a jLabel or jTextfield. My first class is a GUI Where I will want to display the chronometer in a jLabel or JTextField. My second class is where I made ...
Gabriel Luque's user avatar
0 votes
1 answer
3k views

How to display the millisecond (android studio)

I am using kitkat to build a stopwatch, and want it to display the millisecond and remove the minute part as well, Here is my code: public class MainActivity extends AppCompatActivity implements ...
Mark L's user avatar
  • 11
2 votes
1 answer
501 views

Chronometer doesn't start from 00:00:00

I have a problem with the chronometer. When I start it, it begins from 01:00:00. I don't know why. I think that my code is correct. Can you understand what the problem is? This is my code: ...
Deca's user avatar
  • 153
3 votes
4 answers
9k views

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 ...
PinkNGreen's user avatar
1 vote
1 answer
1k views

Chronometer android

Help me please, i did my fist android app, chronometer, but something is wrong here and i dont know what. When I clicked Start the chronometer runs normal, but when I clicked Stop(or Reset), then ...
tuan tran's user avatar
1 vote
2 answers
2k views

Inheritance and private variables in Java

I'm trying to add a method to the Chronometer class in android. It stores the start time in this variable: private long mBase; so I thought I could do this public class MyChronometer extends ...
guribe94's user avatar
  • 1,543
0 votes
2 answers
433 views

android chronometer start from last stop

Although there are answered questions about this, none REALLY answers the following: I want the android chronometer to start from the last stop, NOT to continue counting time. I try the following, but ...
George Violettas's user avatar
0 votes
1 answer
34 views

Strange behavior of a custom adapter when screen is rotated

The main goal is to make a listVeiw with chronometers and you turn the screen to save the state of each timer. But when I run the chronometer and turn the screen there is no matter from which timer ...
Dennis Zinkovski's user avatar
0 votes
1 answer
241 views

Best way to implement a delayed SMS sending after a countdown (Alarm, Chronometer, CountDownTimer)

I need to send a SMS in a future time, i.e. in 5 minutes, and to show in the UI the remaining time in the format 00:00. My first choice was using android-alarm, but I dont know how to show in the ...
José Manuel Gálvez's user avatar
0 votes
1 answer
167 views

Android DateFormat always result in 18:00:00 when it's 00:00:00

I'm trying to do a simple Timer using Android Chronometer. However the timer is starting 18:00:00, not 00:00:00. Can anyone explain why is this occurring please? Here's the code: final Chronometer ...
Unu's user avatar
  • 711
1 vote
1 answer
504 views

Creating a running stopwatch in Android for timing intervals

I want to create a stopwatch in my Android application that starts running when the user presses start and continues to run and enables the user to time specific intervals. Use case: The user presses ...
Digital Da's user avatar
0 votes
0 answers
377 views

Android Stopwatch : Time in Milliseconds not working

I know, I know, there are tons of post on here about this particular problem, however, most of them are very outdated, and none of them comply with the way I wrote this app... I'm fairly new to coding,...
Jackson Eason's user avatar
0 votes
1 answer
511 views

Custom chronometer and time difference

I'm new to C# and I'm trying to make a custom chronometer that is composed of two labels (label1 and label2) that display time strings (time and time0/time1) and one button (pause/play) that changes ...
Luke's user avatar
  • 513
0 votes
0 answers
102 views

Android chronometer counting in characters instead of numbers

I have a chronometer which I set in the following way: long realTime = SystemClock.elapsedRealtime(); long time = alert.Created.getTime(); holder.timeChronometer.setBase(realTime - time); holder....
Octavius's user avatar
-1 votes
2 answers
1k views

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 ...
Jackson Eason's user avatar
2 votes
3 answers
2k views

Android: How to restore the state of a stopped chronometer after rotation?

I'm doing this way to save the state and restore it after rotation when the chronometer is running. Android_Chronometer pause When I stop the timer at Xsec and then after Y seconds I change the ...
user3290180's user avatar
  • 4,350
0 votes
0 answers
136 views

Chronometer app for android

I'm a begginer in android programming and trying to improve my knowledge. I want to make an app that is a regressive chronometer, like this: I insert the seconds I want in a text view named "seconds", ...
Vladimir's user avatar
2 votes
0 answers
142 views

Counter restarts after killing app

I have made an app that starts a counter when I hold the button, and stops counting as soon as I release the button, then start again as soon as I touch it again.. (The app is made to see how long ...
Leitvoll's user avatar
0 votes
2 answers
869 views

Save chronometer value/time? [duplicate]

How can I save my chronometer value? So when I, for example, press the back button or when i "kill" the application, I don't want the timer to reset to 00:00. The code is a a button that you hold and ...
Leitvoll's user avatar
2 votes
1 answer
2k views

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 ...
Paul Alexander's user avatar
0 votes
1 answer
4k views

How to pause and resume Chronometer in Notification Panel?

I have a chronometer in notification panel which I instantiate using remoteView.setChronometer(R.id.notification_timer, SystemClock.elapsedRealtime(), null, true); How ...
Jaswanth Kumar's user avatar
1 vote
0 answers
184 views

Maintaining a chronometer for multiple fragments in swipe tabs

I have swipe tabs (6 fragments) for which I try to maintain each a chronometer. The problem is that the onPause is called after the 3rd tab so I have no ways to stop the chrono. Is there a way to ...
narb's user avatar
  • 988
0 votes
2 answers
3k views

How to keep a Chronometer running in the background?

I have in a Activity (1) A Chronometer and is running fine. I click a Button and starts Chronometer time count. I'm trying to keep the score Chronometer changing Activity (2) but without success. In ...
Victor CS's user avatar
2 votes
0 answers
564 views

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 ...
user3842769's user avatar
1 vote
1 answer
3k views

How to set Chronometer in milliseconds (MM:SS:mm)

I have a chronometer used as a timer in a game. Currently it only shows seconds (by default). I have been trying to get the format to show in minutes:seconds:milliseconds. I tried but nothing is ...
newbdeveloper's user avatar
5 votes
1 answer
6k views

How to get time difference between two dates in Android App?

I'm trying to implement a time counter (counts up from 0) which basically gets the saved time variable (startTime, which was created as soon as the user tapped a button) and subtracts the current time ...
iVikD's user avatar
  • 296
0 votes
1 answer
707 views

Android Chronotmeter onChronometerTick stackoverflowerror?

I am writting a code in Android to develop a Chronometer app. But i am facing some of the error while i am trying to reset the Chronometer on certain time. MyCode: mChronometer.setBase(SystemClock....
user3950841's user avatar
1 vote
1 answer
1k views

How do I save chronometer elapsed time in android app

I'm developing a sort of parking meter counter app for a few specific locations. The app asks the user where he is (dropdown menu, saves column letter and number, like A6) and then shows a screen with ...
iVikD's user avatar
  • 296
-1 votes
1 answer
603 views

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 ...
user3897367's user avatar
0 votes
1 answer
411 views

Is there any equivalent of Chronometer setBase() method in c#?

I am developing app using xamarin in c#. Converting java code I notice that my chronometer doesn't have setBase() method. Is there any equivalent of this method in c#?
user3897367's user avatar
0 votes
0 answers
576 views

Chronometer view: get value in real time and keep it running after destroy

Is there a way to get the real timer of a Chronometer View into a notification ? I have created a chronometer with this view : http://developer.android.com/reference/android/widget/Chronometer.html ...
psv's user avatar
  • 3,257
1 vote
0 answers
64 views

how to set a list of stopwatch in android?

I want to create an android list of stopwatch. I intent that every stopwatch will start counting down 5 minutes after first click only. I have had few questions: I have tried to use chromometer, ...
Elad Benda2's user avatar
  • 14.6k
1 vote
1 answer
540 views

Save the value of a chronometer in android

My application has a timer, which I want to keep running in two situations: Change screen orientation and when the back button is pressed and exits the application. chronometer= (Chronometer) ...
user3764379's user avatar
-1 votes
1 answer
32 views

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 ......
user3764379's user avatar
1 vote
1 answer
991 views

Showing Hours in Chronometer

How do you show hours in chronometer.By default its format is (hh:mm:ss), doesn't show in the view.I need it to show like 00:00:00 , and update the time. I also require to pause the time and resume ...
Tiji Isen's user avatar
0 votes
1 answer
686 views

Android Chronometer: time format issue

Why my chronometer wouldn't stop after I've told it to? I have found out that it seems to be isolated to the tablet I have tested it on (7 inch Galaxy Tab). I have no idea why it would work on my ...
Darren Murtagh's user avatar
0 votes
1 answer
1k views

Increment ProgressBar on Chronometer "Tick" [closed]

I have a Chronometer which increments every second and displays elapsed time on screen. I also have three Progress Bars: SecondsProgressBar MinutesProgressBar HoursProgressBar When the Chronometer ...
Idob's user avatar
  • 1,640
1 vote
2 answers
561 views

Condition to stop Android Chronometer

I am trying to stop my android chronometer when it gets to 10 seconds but I can't seem to get it work. My code is as below for anyone to point me out in the right direction. Thank you. if(chronorun =...
steelthunder's user avatar
0 votes
1 answer
842 views

check if chronometer is running ANDROID

I am working on a simple Chronometer app and I was wondering how to check if a chronometer is running. For example I have the below method to start the Chronometer but if pressed I want it to check to ...
steelthunder's user avatar

1 2 3
4
5
7