Android Count Down Timer Example

  • 0

Android Count Down Timer Example

Category : Uncategorized

In this sample application we will create a countdown timer in android using the CountDownTimer class .This is an example of showing a 30 second countdown in a TextView . We will update the TextView on every tick of the timer.The option to stop and restart the timer is also provided.

So let us start:

1.Create a new project File ->New -> Project ->Android ->Android Application Project. While creating the new project, name the activity as TimerActivity(TimerActivity.java) and layout as activity_timer.xml.

2.Now let us design the UI for the TimerActivity i.e activity_timer.xml with a textview and a button.

activity_timer.xml

01

02

07

08

16

17


Leave a Reply