Relative Content

Tag Archive for androidkotlinandroid-studiomobile

scheduleatfixedrate strikethrough text

void startResendTimer(){ resendOtpTextView.setEnabled(false); Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { timeoutSeconds–; resendOtpTextView.setText(“Resend OTP in “+timeoutSeconds +” seconds”); if(timeoutSeconds<=0){ timeoutSeconds =60L; timer.cancel(); runOnUiThread(() -> { resendOtpTextView.setEnabled(true); }); } } },0,1000); } When I use scheduleAtFixedRate, that entire code block is crossed out. When I use schedule, the event I want […]