Skip to content

Commit

Permalink
Correctly check app state in delayed callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
nkming2 committed Feb 24, 2017
1 parent 4470426 commit 9cbb9f9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/kotlin/com/nkming/powermenu/MainFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ class MainFragment : Fragment()
_restartBtn.bound.setOnClickListener(null)
_showRestartMenu(Res.ANIMATION_FAST / 2,
{
activity ?: return@_showRestartMenu
_initRestartBtns()
})
}
Expand All @@ -231,11 +232,7 @@ class MainFragment : Fragment()
.toLong()
_startReveal(_screenshotBtn.btn, R.color.screenshot_bg, true,
{
// App probably closed
if (activity == null)
{
return@_startReveal
}
activity ?: return@_startReveal
activity.finish()

val receiver = object: BroadcastReceiver()
Expand Down

0 comments on commit 9cbb9f9

Please sign in to comment.