How to kill CountDownTimer When I start an activity?

view story

http://stackoverflow.com – I have two activities. ActivityA has a countdowntimer. When I start ActivityB from ActivityA , timer doesn't stop. How can I do it ? myTimer = new CountDownTimer(20000, 1000) { @Override public void onFinish() Intent mainIntent = new Intent(QRcode.this,ActivityC.class); QRcode.this.startActivity(mainIntent); }; myTimer.start(); Intent mainIntent = new Intent(QRcode.this,ActivityB.class); QRcode.this.startActivity(mainIntent); (HowTos)