Answers for "sartt timer of 40 second when send otp andrpid"

0

sartt timer of 40 second when send otp andrpid

public void reverseTimer(int Seconds,final TextView tv){

    new CountDownTimer(Seconds* 1000+1000, 1000) {

        public void onTick(long millisUntilFinished) {
            int seconds = (int) (millisUntilFinished / 1000);
            int minutes = seconds / 60;
            seconds = seconds % 60;
            tv.setText("TIME : " + String.format("%02d", minutes)
                    + ":" + String.format("%02d", seconds));
        }

        public void onFinish() {
            tv.setText("Completed");
        }
    }.start();
}
Posted by: Guest on October-09-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language