Advertisement
Guest User

Untitled

a guest
Oct 25th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.86 KB | None | 0 0
  1. long tiempo = 1;
  2.  
  3.         CountDownTimer timer = new CountDownTimer(tiempo * 60 * 1000, 100) {
  4.             @Override
  5.             public void onTick(long millisUntilFinished) {
  6.             }
  7.  
  8.             @Override
  9.             public void onFinish() {
  10.                 CountDownTimer timer2 = new CountDownTimer(1 * 60 * 1000, 100) {
  11.                     @Override
  12.                     public void onTick(long millisUntilFinished) {
  13.                         contador.setText(getResources().getString(R.string.time_remaining) +
  14.                                 " " + String.valueOf(millisUntilFinished / 1000));
  15.                     }
  16.  
  17.                     @Override
  18.                     public void onFinish() {
  19.                         finish();
  20.                     }
  21.                 };
  22.                 timer2.start();
  23.             }
  24.         };
  25.         timer.start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement