2

There is a croos button in notification, how to add that??

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.

Pranav Sharma
  • 692
  • 2
  • 9
  • 22

2 Answers2

2

Use a Custom Notification Layout as outlined in the documentation.

myanimal
  • 3,580
  • 26
  • 26
2

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.

Community
  • 1
  • 1
Toon Borgers
  • 3,638
  • 1
  • 14
  • 22