CountDownTimer onfinish method run after change activity
<p>I use CountDownTimer in my code and when i run app i have one problem that is when i go to next level ( go to next activity ) the timer should be stop and dont run the onfinish method but when the first level timer down it run the onfinish method and go to activity GameOver . </p>

<p>I use Intent to move between my activity and my CountDownTimer is : </p>

<pre><code>new CountDownTimer(timeoflevel, 1000) {

        public void onTick(long millisUntilFinished) {
            txtclock2.setText("Time: " + millisUntilFinished / 1000);
            //here you can have your logic to set text to edittext
        }

        public void onFinish() {

            txtclock2.setText("..Finish..");
            Intent intent = new Intent(Play.this , GameOver.class);
            startActivity(intent);
        }

    }.start();
</code></pre>

<p>Sorry for my easy question and thanks for reading .</p>