Issue
I have two EditTexts in XML. In one EditText, the user can put a number as minutes and in another EditText, a number as seconds. After clicking the finish button, the seconds EditText should start to countdown and update its text every second.
Additionally, how can I keep it updating until it gets to zero minutes and zero seconds?
Solution
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() {
mTextField.setText("done!");
}
}.start();
Refer to this link.
Answered By - Shankar Agarwal
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.