I found out what's going on here, for explicit deep links
its supposed to go to a new back stack which is what you app would have if a user had naturally navigated to the view not the existing back stack (existing stack is cleared.
When a user opens your app via an explicit deep link, the task back stack is cleared and replaced with the deep link destination. When nesting graphs, the start destination from each level of nesting—that is, the start destination from each element in the hierarchy—is also added to the stack. This means that when a user presses the Back button from a deep link destination, they navigate back up the navigation stack just as though they entered your app from its entry point.
For implicit
its a bit strange. You can make it do what explicit
does but setting Intent.FLAG_ACTIVITY_NEW_TASK
otherwise the back button
and the navigation up
button do two separate things:
The back button
will do as you might expect, it will go back in your apps existing back stack and load that fragment.
The up button
however will clear
the a back stack
and make a new one as if it was an explicit link
.
If the flag is not set, you remain on the task stack of the previous app where the implicit deep link was triggered. In this case, the Back button takes you back to the previous app, while the Up button starts your app's task on the hierarchical parent destination within your navigation graph.kquote
Source: Android Documentation