Hi there, question about navigation components and...
# navigation-architecture-component
j
Hi there, question about navigation components and the use of: https://github.com/android/architecture-components-samples/blob/master/NavigationAdvancedSample/app/src/main/java/com/example/android/navigationadvancedsample/NavigationExtensions.kt I have a bottomNavigationView with 5 tabs (therefore 5 navigation graphs) and each tab has its own deep links. I'm having an issue with deep links where if I leave the app with the second tab selected, push an intent that deep links to the first tab, the app is open on the second tab and the linking doesn't happen. I have also added the following code:
Copy code
override fun onNewIntent(intent: Intent) {
    super.onNewIntent(intent)

    if (currentNavController?.value?.handleDeepLink(intent) == false) {
    ...
    }
}
I understand the problem, basically the
currentNavController.value
which has the
navigation_graph_2.xml
doesnt have such deep link set...how can I check if other graphs (tabs) support such deep link and then navigate to the desired tab?
f
Hi, I think our problems are related. Have you found a solution?
j
Hi, yes. Someone at google helped me here
"You should stop using a 
launchMode
 on your activity, which would remove the need for 
onNewIntent()
 and NavigationExtensions would handle it for you, since it checks through every graph to find a matching deep link"
f
Thanks so much for getting back to me. I'm not using
launchMode
in my app so I guess our problems are different. How did you get the help you needed? My question is right above your question and I don't know where to turn.
j
For sure! I asked on #android
👍 1