Reputation: 684
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.
Upvotes: 2
Views: 1015
Reputation: 3658
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.
Upvotes: 2
Reputation: 3620
Use a Custom Notification Layout as outlined in the documentation.
Upvotes: 2