How can i pause the handler.postDelayed()
timer using a button. So when i click the same button again the handler.postDelayed()
timer should resume.
handler.postDelayed(counterz, 60);
Handler
does not have a timer to tweak. You are posting to event-queue of a thread, where a lot of other stuff is running as well.
You can cancel posted Runnable
's:
handler.removeCallbacks(counterz);
And post again, to resume.
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