Thursday, April 4, 2013

Timer in android


How to set coundown timer in android
reverse countdown android

first declare textview


TextView tv = (TextView)findViewById(R.id.textView1);


new CountDownTimer(30000, 1000) {

public void onTick(long millisUntilFinished) {
tv.setText("Seconds remaining: " + millisUntilFinished / 1000);
}

public void onFinish() {
tv.setText("done!");
}
}.start();


timer for 30 sec.. is ready

No comments:

Post a Comment