I'm trying to open a fragment with args from my notification. Actually, in my case, I have Audio Player running with Foreground Service with Notification and now I want to navigate to my fragment for that specific Audio by passing Audio Id when a user clicks to the Notification.
You can open your activity with PendingIntent
then open your fragment via handling the Intent
inside of your activity.
or this answer from similar topic
NavDeepLinkBuilder:
val pendingIntent = NavDeepLinkBuilder(context)
.setComponentName(YourActivity::class.java)
.setGraph(R.navigation.your_nav_graph)
.setDestination(R.id.your_destination)
.setArguments(bundle)
.createPendingIntent()
//then
notificationBuilder.setContentIntent(pendingIntent)