Skip to content

Commit

Permalink
Fix crash when pressing home from root screen (#1578)
Browse files Browse the repository at this point in the history
This bug only happens on older Android devices.

Fixes #1555
  • Loading branch information
pyricau committed Sep 11, 2019
1 parent 5391fcd commit 274f58f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ internal abstract class NavigatingActivity : Activity() {
val actionBar = actionBar
?: // https://github.com/square/leakcanary/issues/967
return
actionBar.setDisplayHomeAsUpEnabled(backstack.size > 0)
val homeEnabled = backstack.size > 0
actionBar.setDisplayHomeAsUpEnabled(homeEnabled)
actionBar.setHomeButtonEnabled(homeEnabled)
}

override fun onCreateOptionsMenu(menu: Menu): Boolean {
Expand Down

0 comments on commit 274f58f

Please sign in to comment.