
the screenshot contains notifications from two different applications. in the upper notification , there is a cancel button, How to add that button in notification. Any help will be extremely thankful.

the screenshot contains notifications from two different applications. in the upper notification , there is a cancel button, How to add that button in notification. Any help will be extremely thankful.
You'd need to create a notification with a custom layout (view here) how to do that. You can attach a click listener with a pending intent to a button like so.