Skip to content Skip to sidebar Skip to footer

Android:if Not Happen In 15 Seconds Do This Condition

I want to add a condition on OTP recieve app.In which if its not signing up automatically when message come after 15 seconds it should allow the user to manually enter the OTP.I t

Solution 1:

   private CountDownTimer countDownTimer = new CountDownTimer(15000, 1000 / 100) {
    @Override
    public void onTick(long l) {
       // call when timer start
    }

    @Override
    public void onFinish() {

        Toast.makeText(MainActivity.this, "Done",    Toast.LENGTH_SHORT).show();
    }
};

to start Timer

countDownTimer.start()

Post a Comment for "Android:if Not Happen In 15 Seconds Do This Condition"