title: CountDownTimer does not stop when calling cancel() method
body: <p>I'm doing a simple game called "The Amazing Race".
  Overview of the program: A program which has three animals participating in the race, including pig, chicken and turtle, will let players guess which animal will win in the race.
  However, I am struggling in cancel() method of CountDownTimer Object. I cannot understand why the cancel() method did not work (Even though one of the animals get to the destination, but the other two still run to the end)</p>
  
  <pre><code>                    countDownTimer = new CountDownTimer(10000, 300) {
                      @Override
                      public void onTick(long millisUntilFinished) {
                          Random rd = new Random();
  
                          if (skbGa.getProgress() &gt;= skbGa.getMax()) {
                              this.cancel();
                              Toast.makeText(MainActivity.this, "Gà thắng", Toast.LENGTH_SHORT).show();
                          }
                          if (skbLon.getProgress() &gt;= skbLon.getMax()) {
                              this.cancel();
                              Toast.makeText(MainActivity.this, "Lợn thắng", Toast.LENGTH_SHORT).show();
                          }
                          if (skbRua.getProgress() &gt;= skbRua.getMax()) {
                              this.cancel();
                              Toast.makeText(MainActivity.this, "Rùa thắng", Toast.LENGTH_SHORT).show();
                          }
  
                          skbGa.setProgress(skbGa.getProgress() + (rd.nextInt(10) + 1));
                          skbLon.setProgress(skbLon.getProgress() + (rd.nextInt(10) + 1));
                          skbRua.setProgress(skbRua.getProgress() + (rd.nextInt(10) + 1));
                      }
  
                      @Override
                      public void onFinish() {
  
                      }
                  };
  
                  countDownTimer.start();
  </code></pre>
  
  <p>The entire code of my program</p>
  
  <pre><code>package quynhanhhle.theamazingrace;
  
  import android.os.Bundle;
  import android.os.CountDownTimer;
  import android.support.v7.app.AppCompatActivity;
  import android.view.View;
  import android.widget.CheckBox;
  import android.widget.CompoundButton;
  import android.widget.ImageButton;
  import android.widget.SeekBar;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import java.util.Random;
  
  public class MainActivity extends AppCompatActivity {
      TextView txtDiem;
      CheckBox chkGa, chkRua, chkLon;
      SeekBar skbGa, skbRua, skbLon;
      ImageButton btnBatDau;
      CountDownTimer countDownTimer;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          anhXa();
  
          xuLyCheckBox();
  
          chuongTrinhChinh();
  
          choiLai();
      }
  
      private void choiLai() {
          btnBatDau.setVisibility(View.VISIBLE);
          chkRua.setEnabled(true);
          chkLon.setEnabled(true);
          chkGa.setEnabled(true);
      }
  
      private void chuongTrinhChinh() {
          btnBatDau.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  if (!(chkLon.isChecked() || chkGa.isChecked() || chkRua.isChecked())) {
                      Toast.makeText(MainActivity.this, "Đoán con vật chiến thắng", Toast.LENGTH_SHORT).show();
                  } else {
                      btnBatDau.setVisibility(View.INVISIBLE);
                      chkGa.setEnabled(false);
                      chkLon.setEnabled(false);
                      chkRua.setEnabled(false);
  
                      countDownTimer = new CountDownTimer(10000, 300) {
                          @Override
                          public void onTick(long millisUntilFinished) {
                              Random rd = new Random();
  
                              if (skbGa.getProgress() &gt;= skbGa.getMax()) {
                                  this.cancel();
                                  Toast.makeText(MainActivity.this, "Gà thắng", Toast.LENGTH_SHORT).show();
                              }
                              if (skbLon.getProgress() &gt;= skbLon.getMax()) {
                                  this.cancel();
                                  Toast.makeText(MainActivity.this, "Lợn thắng", Toast.LENGTH_SHORT).show();
                              }
                              if (skbRua.getProgress() &gt;= skbRua.getMax()) {
                                  this.cancel();
                                  Toast.makeText(MainActivity.this, "Rùa thắng", Toast.LENGTH_SHORT).show();
                              }
  
                              skbGa.setProgress(skbGa.getProgress() + (rd.nextInt(10) + 1));
                              skbLon.setProgress(skbLon.getProgress() + (rd.nextInt(10) + 1));
                              skbRua.setProgress(skbRua.getProgress() + (rd.nextInt(10) + 1));
                          }
  
                          @Override
                          public void onFinish() {
  
                          }
                      };
  
                      countDownTimer.start();
                  }
              }
          });
  
      }
  
      private void xuLyCheckBox() {
          chkGa.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
              @Override
              public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                  if (chkGa.isChecked()){
                      chkLon.setChecked(false);
                      chkRua.setChecked(false);
                  }
              }
          });
  
          chkLon.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
              @Override
              public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                  if (chkLon.isChecked()){
                      chkGa.setChecked(false);
                      chkRua.setChecked(false);
                  }
              }
          });
  
          chkRua.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
              @Override
              public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                  if (chkRua.isChecked()){
                      chkGa.setChecked(false);
                      chkLon.setChecked(false);
                  }
              }
          });
      }
  
      private void anhXa() {
  
          txtDiem = (TextView) findViewById(R.id.txtDiem);
  
          chkGa = (CheckBox) findViewById(R.id.chkGa);
  
          chkLon = (CheckBox) findViewById(R.id.chkLon);
  
          chkRua = (CheckBox) findViewById(R.id.chkRua);
  
          skbGa = (SeekBar) findViewById(R.id.skbGa);
  
          skbLon = (SeekBar) findViewById(R.id.skbLon);
  
          skbRua = (SeekBar) findViewById(R.id.skbRua);
  
          btnBatDau = (ImageButton) findViewById(R.id.btnBatDau);
      }
  }
  </code></pre>