Prevent multiple alarm timers running at once

This commit is contained in:
Brandon Presley 2024-02-18 00:50:08 +13:00
parent 8162724328
commit c6ac2cae86
1 changed files with 1 additions and 0 deletions

View File

@ -71,6 +71,7 @@ class TimerService : Service() {
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
timerRunnable?.let { timerHandler.removeCallbacks(it) }
secondsLeft = (intent?.getIntExtra("milliseconds", 0) ?: 0) / 1000
currentDescription = intent?.getStringExtra("description").toString()
secondsTotal = secondsLeft