https://kotlinlang.org logo
Title
j

Joao Birk

06/02/2020, 7:29 PM
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:
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

Fidelity Chauke

06/09/2020, 12:58 PM
Hi, I think our problems are related. Have you found a solution?
j

Joao Birk

06/09/2020, 7:59 PM
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

Fidelity Chauke

06/09/2020, 8:58 PM
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

Joao Birk

06/12/2020, 10:17 PM
For sure! I asked on #android
👍 1