Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
Workaround for mysterious IllegalStateException
Browse files Browse the repository at this point in the history
  • Loading branch information
DreierF committed Jan 12, 2018
1 parent e87b68c commit 76fdae3
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,12 @@ abstract class TimerFragmentBase : Fragment(), View.OnClickListener {
}

private fun playHorn(n: Int) {
horn.start()
horn.setOnCompletionListener {
if (n > 1) {
playHorn(n - 1)
if(!horn.isPlaying && !isDetached) {
horn.start()
horn.setOnCompletionListener {
if (n > 1) {
playHorn(n - 1)
}
}
}
}
Expand Down

0 comments on commit 76fdae3

Please sign in to comment.