[android] fix FragmentBackStackActivity navigation

This commit is contained in:
Łukasz Paczos
2019-05-15 16:03:18 +02:00
committed by Łukasz Paczos
parent 0ecf45edbd
commit ab8caabd15

View File

@@ -45,8 +45,12 @@ class FragmentBackStackActivity : AppCompatActivity() {
}
override fun onBackPressed() {
// activity uses singleInstance for testing purposes
// code below provides a default navigation when using the app
NavUtils.navigateHome(this)
if (supportFragmentManager.backStackEntryCount == 0) {
// activity uses singleInstance for testing purposes
// code below provides a default navigation when using the app
NavUtils.navigateHome(this)
} else {
super.onBackPressed()
}
}
}