Android's NavDeepLinkBuilder does not have option to not clear the task

Viewed 464

As stated in the documentation below, the NavDeepLinkBuilder will clear the task. But what if I don't want it to be cleared? Especially when my App is already in the foreground. It is a bad experience for the user! I have "singleTop" for my activity enabled.

https://developer.android.com/reference/androidx/navigation/NavDeepLinkBuilder

When this deep link is triggered:

The task is cleared.

1 Answers

I used a workaround here. I will always use Deep Link to my main activity with parameters to indicate which destination the User has to be taken to. The destination will have a global action that will be used in case of the Deep Link.

Related