CountDownTimer runs in old Activity when switching Activities
<p>I have a CountDownTimer, which needs to run all the time. There are 2 Activities (A and B). Activity A has the CountDownTimer, which updates a TextView inside it. When I switch to B, the CountDownTimer still runs (it is the desired behavoir), but when I switch back to A, there seems to be an old and a new A. The timer does not update a TextView inside of the "new" A. It is started only once when A is first visited. Any ideas of how to solve this problem? Maybe put the timer somewhere else?<br>
<strong>Edit:</strong> Some code:  </p>

<pre><code>private void prepareTimer() {
    // TODO: DOES NOT WORK YET! (switching activities -&gt; runs in old activity)
    textTime = (TextView) findViewById(R.id.text_time); // is a field

    if (!timerRunning) {
        timerRunning = true;

        int duration = 60000;
        timer = new CountDownTimer(duration, 1000) {

            public void onTick(long millisUntilFinished) {
                long minsLeft = (long) Math.floor((double) millisUntilFinished / (double) Constants.ONE_MINUTE) + 1;
                textTime.setText(minsLeft + " Min.");
            }

            public void onFinish() {
                textTime.setText("done!");
            }
        };
        timer.start();
    }
}
</code></pre>
