Let's say we have a bottom navigation view with 4 tabs, we have a deeplink for a fragment of 4 tab, so when navigating from this deeplink to 4 tab - it works as it should, but when after that manually select the first tab, a fragment of 4 tab is added also in the first tab.
i have a nav graph with 4 fragments
in on create of my activity i set the bottom view with nav controller
navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as? NavHostFragment navController = navHostFragment?.navController navController?.setGraph(R.navigation.nav_unauth_state) navView.inflateMenu(getBottomNavViewMenu()) navController?.let { navView.setupWithNavController(it) }
in manifest for this activity i added
<nav-graph android:value="@navigation/nav_unauth_state" />
in nav_unauth_state for frgament i set the deeplink
android:id="@+id/deepLink2"
app:uri="https://<my_secret_url>/{action}" />