Updated on 2026-08-14
This commit is contained in:
commit
8312c85fa6
1 changed files with 3 additions and 1 deletions
|
|
@ -62,7 +62,9 @@ fun FragmentActivity.popBackTo(screen: AppScreen?, inclusive: Boolean = false) {
|
|||
|
||||
fun FragmentActivity.getPreviousScreen(): AppScreen? {
|
||||
val indexOfLastFragment = this.supportFragmentManager.backStackEntryCount - 1
|
||||
val tag = this.supportFragmentManager.getBackStackEntryAt(indexOfLastFragment).name
|
||||
val tag = if (indexOfLastFragment < this.supportFragmentManager.backStackEntryCount)
|
||||
this.supportFragmentManager.getBackStackEntryAt(indexOfLastFragment).name
|
||||
else null
|
||||
return tag?.let { AppScreen.valueOf(tag) }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue