I am writing an app in Kotlin that should display a notification with an action button.
I have a class. Let's call it NotificationClass
This class creates notifications for me via fun createNotification()
This all works fine. But I want to add a button to the notification that, when clicked, triggers a function in my NotificationClass
called notificationActionClicked()
.
Is there a way I can do this?
(The notification class is not an android service. It's just an utility class.)
you need to take look about pending intent