show a toast at stopping timer or stopwatch if it is running at onDestroy

This commit is contained in:
tibbi
2018-03-09 21:57:49 +01:00
parent b771f05881
commit 5878af2cc5
5 changed files with 12 additions and 0 deletions

View File

@ -100,6 +100,9 @@ class StopwatchFragment : Fragment() {
override fun onDestroy() {
super.onDestroy()
if (isRunning) {
context?.toast(R.string.stopwatch_stopped)
}
isRunning = false
updateHandler.removeCallbacks(updateRunnable)
}

View File

@ -69,6 +69,9 @@ class TimerFragment : Fragment() {
override fun onDestroy() {
super.onDestroy()
if (isRunning) {
context?.toast(R.string.timer_stopped)
}
isRunning = false
updateHandler.removeCallbacks(updateRunnable)
}