//set on time 132 second and resend
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(getString(R.string.nototp));
tv.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
reverseTimer(90,tv);
// new OTPDATA().execute(); }
});
}
}.start();
}
No comments:
Post a Comment