Sabbir Ahmed Sabbir Ahmed - 1 year ago 88
Android Question

How to make a countdown Timer in android?

I have two edit texts in xml, In one edittext user can put a number as minute and in another one as seconds. After clicking the finish button the seconds edittext should start to countdown and updating its text every second. Aditionally how can I keep this updating until it comes into zero minutes zero seconds?

Answer Source
new CountDownTimer(30000, 1000) {

    public void onTick(long millisUntilFinished) {
        mTextField.setText("seconds remaining: " + millisUntilFinished / 1000);
       //here you can have your logic to set text to edittext

    public void onFinish() {


Refer to this link.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download