0

I have two urls which falls under the same deep link like below :

xxx.yyy.zzz/pages

xxx.yyy.zzz/how-deeplinks-work-exactly

Now the first one is a list of pages which goes to a fragment which lists the list of pages and second goes to a fragment which shows the details of that page.

Scenario :

https://github.com/android/architecture-components-samples/tree/master/NavigationAdvancedSample

I am following the above sample for having independent stacks for each tab. When I have two different deep links for the above two links, it navigates to both the fragments. Like when I open the app with xxx.yyy.zzz/pages url it opens both the PagesFragment and DetailFragment one after another. So when I press back button from PagesFragment it navigates back to DetailFragment.

Now how do I handle these two scenario with deep links. If have both the deep links setup it navigates to both the screens one by one. I know I can change the path and add a prefix the page detail url(xxx.yyy.zzz/page/how-deeplinks-work-exactly), but is there anyway I can intercept the parsing logic or add some exclude condition to achieve this without changing the url scheme?

Edit : This is likely an issue with the Navigation logic (NavigationExtensions.kt) written for having individual stack.

Kingston
  • 474
  • 5
  • 14
  • What exactly is your problem? Having those are two separate deep links on two separate destinations works just fine. Please include what code you've tried. – ianhanniballake Nov 03 '20 at 06:43
  • I have edited the question with the scenario. – Kingston Nov 03 '20 at 07:19
  • It is still entirely unclear what exactly you're doing. Are both of these deep links in the same graph? Different graphs? Can you include the relevant navigation graph XML files so we can see what the relationship is between these two destinations, how you've declared your deep links, etc. – ianhanniballake Nov 03 '20 at 15:05

1 Answers1

0

You shouldn't use NavigationExtensions.kt anymore, instead increase your navigation component library version. Check this article out: https://medium.com/androiddevelopers/navigation-multiple-back-stacks-6c67ba41952f

Perhaps upgrading the lib version also changes the behaviour of your app with respect to the deep links

Tommy 90
  • 21
  • 2