Disable multiple backstack #115
Comments
@Hussienfahmy did you find any way to disable it? |
@similincbose Unfortunately no. |
@Hussienfahmy hey got it binding.bottomnavigationbar.apply {
setupWithNavController(navController)
setOnItemSelectedListener { item ->
NavigationUI.onNavDestinationSelected(item, navController)
navController.popBackStack(item.itemId, inclusive = false)
true
}
} |
@similincbose Can you mention some references regarding this because i want Java version of the above code. |
Got it .. Thanks :) Java Code will be:- bottomNavigationView.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { |
邮件已经收到了,谢谢!
|
I think I have found a better way how to disable it. Just call onNavDestinationSelected with false: binding.bottomnavigationbar.apply {
setupWithNavController(navController)
setOnItemSelectedListener { item ->
NavigationUI.onNavDestinationSelected(item, navController, false)
true
}
} I use 2.5.0 version of navigation components |
Update: I found this soultion as NavigationUI.kt
so the final solution work for me on 2.5.0 vesion is:
But I had to add it to all menu to do the correct behavior of bottom sheet. |
邮件已经收到了,谢谢!
|
|
邮件已经收到了,谢谢!
|
Hello I have an inquiry,
Mr. Murat Yener mentioned here that multiple backstack is enabled by default, but he didn't mention how to disable it
How I can disable Multiple backstack
The text was updated successfully, but these errors were encountered: