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?
The great thing about the Android timer apps is that they don't just count down seconds, but it also has widgets placed on the home screen. That means you can access the timer feature without opening the app itself.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With