Hello, I'm using the deep link trick to navigate t...
# compose
l
Hello, I'm using the deep link trick to navigate to a composable from a notification, and there's an issue I'm having that I didn't have when I was using separate activities and pendingintents without deeplinks: The state of the previous destination is always lost on navigating from the link, the entire activity being destroyed, even after navigating multiple times from the very same deep link uri. I'd like to not have that useless recreation and state loss happen when the deep link points to the destination already on top. Is that possible at the moment, or shall I file a feature request? Note that I specified
android:launchMode="singleTop"
in the
AndroidManifest.xml
for the host Activity.
i
No, that always will happen and is working as intended (both the activity task stack and the navigation back stack are purposefully reset to ensure consistency for every deep link, no matter what the previous state). You should not use anything but the default launchMode
👍 1
l
Opening back the app from a notification from the very same app isn't exactly the same expected behavior as when opening from a link in another app or website. Especially when that notification is from a foreground service. I ended up not using the IMHO wrong recommendation to use deep links for app notifications, rolling my own mechanism instead, that has a YouTube Music like behavior.