If understand CountDownTimer correctly, it doesn't run on a separate thread from the activity that started it. So does that mean if I start a CountDownTimer in my main activity, and another piece of code later blocks in the activity, does this mean the CountDownTimer will no longer update as the thread is tied up?
and if so, would the CountDownTimer attached to the main activity also stop updating if I launch a second activity?
If the CountdownTimer is started in the main thread, then any blocking call in the main thread will delay the Ontick
and Onfinish
().
But the second part is not true, since even if the next activity is started, the main thread is still running. So the CountdownTimer
will continue to run even if you launch the second activity
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With