architecture-components-samples icon indicating copy to clipboard operation
architecture-components-samples copied to clipboard

Navigate in all nav graphs when received deep link via intent in NavigationExtensions

Open javaherisaber opened this issue 3 years ago • 0 comments

When we have multiple graphs in navHostFragment and we also have opened app with deep link intent, there is a bug which is navigating to received deep link in all of our graphs (we want to navigate with deep link in a single graph) example app: an activity with bottom navigation view with navigation graph's for each menu item

Here, when we obtain navHostFragment, deep link is being handled in internal code of NavController https://github.com/android/architecture-components-samples/blob/7466ae2015bb9bd9cf2c435a350070b29d71fd2b/NavigationAdvancedSample/app/src/main/java/com/example/android/navigationadvancedsample/NavigationExtensions.kt#L54

So at this point, our deep link caused all our nav graphs to navigate https://github.com/android/architecture-components-samples/blob/7466ae2015bb9bd9cf2c435a350070b29d71fd2b/NavigationAdvancedSample/app/src/main/java/com/example/android/navigationadvancedsample/NavigationExtensions.kt#L138

javaherisaber avatar Jan 30 '21 08:01 javaherisaber