It looks like there is already an api for just that:
new CountDownTimer(30000, 1000) {
public void onTick(long millisUntilFinished) {
mTextField.setText("seconds remaining: " + millisUntilFinished / 1000);
}
public void onFinish() {
mTextField.setText("done!");
}
}.start();
Reference:
http://developer.android.com/reference/android/os/CountDownTimer.html
solved How to use Chronometer on Android?