Questions tagged [countdowntimer]

The Android `CountDownTimer` class. Do not use this tag for any countdown timer-related question that is not related to the Android class

The Android CountDownTimer class. This class allows scheduling a task in Android. The task can be one-shot-executed or executed in defined time intervals.

Do not use this tag for any countdown timer-related question that is not related to the Android class

1696 questions
316
votes
3 answers

How to write a countdown timer in JavaScript?

Just wanted to ask how to create the simplest possible countdown timer. There'll be a sentence on the site saying: "Registration closes in 05:00 minutes!" So, what I want to do is to create a simple js countdown timer that goes from "05:00" to…
Bartek
  • 3,203
  • 3
  • 12
  • 5
226
votes
19 answers

How to convert milliseconds to "hh:mm:ss" format?

I'm confused. After stumbling upon this thread, I tried to figure out how to format a countdown timer that had the format hh:mm:ss. Here's my attempt - //hh:mm:ss String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours(millis), …
mre
  • 43,520
  • 33
  • 120
  • 170
79
votes
10 answers

How to create a simple countdown timer in Kotlin?

I know how to create a simple countdown timer in Java. But I'd like to create this one in Kotlin. package android.os; new CountDownTimer(20000, 1000) { public void onTick(long millisUntilFinished) { mTextField.setText("seconds…
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
52
votes
12 answers

Android: CountDownTimer skips last onTick()!

Code: public class SMH extends Activity { public void onCreate(Bundle b) { super.onCreate(b); setContentView(R.layout.main); TextView tv = (TextView) findViewById(R.id.tv); new CountDownTimer(10000,…
37
votes
9 answers

Android: How to pause and resume a Count Down Timer?

I have developed a Count Down Timer and I am not sure how to pause and resume the timer as the textview for the timer is being clicked. Click to start then click again to pause and to resume, click again the timer's text view. This is my code: …
Mineko
  • 641
  • 2
  • 14
  • 21
31
votes
12 answers

Display a countdown for the python sleep function

I am using time.sleep(10) in my program. Can display the countdown in the shell when I run my program? >>>run_my_program() tasks done, now sleeping for 10 seconds and then I want it to do 10,9,8,7.... is this possible?
user1681664
  • 1,771
  • 8
  • 28
  • 53
29
votes
4 answers

How to stop CountDownTimer in android

How to stop this timer , any idea ? I want to reset timer in every query but it continues. Every new query it adds new timer. How to solve this? new CountDownTimer(zaman, 1000) { //geriye sayma public void…
Taha
  • 347
  • 1
  • 4
  • 9
27
votes
1 answer

CountDown Timer ios tutorial?

I'm making an application where the exams is going on, so when exam start the, time should start with that. For example 30 minutes and it should reduce like 29:59. How can I implement this? Can anyone please give me a sample example or a easy step…
zeeshan shaikh
  • 819
  • 3
  • 18
  • 33
23
votes
4 answers

Checking if CountDownTimer is running

Ive been looking to see a method to see if a CountDownTimer is running or not, but I cant find a way to, any help would be greatly appreciated if (position == 0) { mCountDown = new CountDownTimer((300 * 1000), 1000) { public void…
user3224105
  • 267
  • 1
  • 2
  • 8
19
votes
4 answers

Circular Progress Bar ( for a countdown timer )

Ok so I have a countdown timer of 15 seconds that works perfectly fine and I'd like to make a custom circular progress bar for that timer. I want to create a full circle that gets "slices of the pie (circle)" taken out as the timer goes down until…
David Baez
  • 1,208
  • 1
  • 14
  • 26
18
votes
3 answers

Multiple count down timers in RecyclerView flickering when scrolled

I have implemented count down timer for each item of RecyclerView which is in a fragment activity. The count down timer shows the time remaining for expiry. The count down timer is working fine but when scrolled up it starts flickering. Searched a…
Hasan shaikh
  • 738
  • 1
  • 6
  • 16
18
votes
4 answers

How to handle multiple countdown timers in ListView?

I have a listview (with a custom list adapter), I need to display a countdown on every row. For example, if my list contains 4 items, I will have 4 rows. At this point, I need to handle 4 different countdowns (one for each row) because time is…
Rob
  • 748
  • 2
  • 7
  • 16
18
votes
2 answers

Countdown timer in HH:MM:SS format in Android

I am trying to develop a countdown timer in android. In this example I am entering a number of minutes as a parameter which is shown in a countdown timer. The problem is that when I am entering minutes, for example 65, then the counter will be…
17
votes
4 answers

How to use timer in C?

What is the method to use a timer in C? I need to wait until 500 ms for a job. Please mention any good way to do this job. I used sleep(3); But this method does not do any work in that time duration. I have something that will try until that time to…
user2332426
16
votes
2 answers

Angular 2 - Countdown timer

I am willing to do a countdown timer in Angular 2 that start from 60 (i.e 59, 58,57, etc...) For that I have the following: constructor(){ Observable.timer(0,1000).subscribe(timer=>{ this.counter = timer; }); } The above, ticks every second,…
Folky.H
  • 1,164
  • 4
  • 15
  • 37
1
2 3
99 100