title: How can I keep a Timer running when the app is closed? (Kotlin)
body: <p>I have a textView in my 2nd activity, that displays the time left (counting down from 24 hours) when the activity is started and navigates back to MainActivity when it is finished. However, when I close the app, this timer restarts. How would I make the timer continue to run, even when the app is closed and the user is not using it?</p>
  <p>Some reference code would be appreciated. Thanks.</p>
  <pre><code>// timer
      object : CountDownTimer(10000, 1000) {
          override fun onTick(millisUntilFinished: Long) {
              (millisUntilFinished / 1000).also { clock.text = it.toString() }
          }
          override fun onFinish() {
              &quot;Done!&quot;.also { clock.text = it }
          }
      }.start()
  
      if(clock.text.toString().trim().contains(&quot;Done!&quot;)){
          val intent3 = Intent(this, MainActivity ::class.java)
          startActivity(intent3)
      }
  </code></pre>