which has quite some code to support multiple back...
# android
which has quite some code to support multiple back stacks.
google 2
stackoverflow 2
Jetpack Navigation doesn't support multiple backstacks out of the box yet. We use separate (xml) navgraphs with the linked extension and so far it works.
Phew, together with a colleague after couple hours of debugging we found out the order nav graphs id's matter. We first got very weird behavior of multiple fragments on top of each other.
They have to match, yes. ^^
Well the nav graphs id's did match the bottom nav menu id's. But that's not enough. This order also needs to match:
Copy code
private fun setupBottomNavigationBar() {
    val navGraphIds = listOf(

    // Setup the bottom navigation view with a list of navigation graphs
    val controller: LiveData<NavController> = binding.globalBottomNav.setupWithNavController(
            navGraphIds = navGraphIds,
            fragmentManager = supportFragmentManager,
            containerId = R.id.global_nav_host_fragment,
            intent = intent
That's what I meant, yep. I remember that Ian Lake said sometime it's necessary to rewrite parts of the fragment in order to support multiple backstacks out of the box. So I guess one has to live with that for now. ^^
It might messy to use just one activity this is how I break mine down if I have authentication I would create a graph to handle only auth then another graph for dashboard if dashboard has like account section and account has children I,LL create a graph to handle it children
Just to avoid mess and keep a clean code