You are on page 1of 1

countDownTimer = new CountDownTimer(5000, 1000) {

public void onTick(long millisUntilFinished) {


// Toast.makeText(TransFail.this, "Saliendo en " +
millisUntilFinished / 1000 + " segundos", Toast.LENGTH_SHORT).show();
}

public void onFinish() {


startActivity(new Intent(TransFail.this, MainActivity.class));
finish();
}
}.start();

exitFail = findViewById(R.id.exitFail);
exitFail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(TransFail.this, MainActivity.class));
countDownTimer.cancel();
finish();
}
});

You might also like