Sartheris Stormhammer
Sartheris Stormhammer

Reputation: 2564

Cancel Notification with the buttons

I have a notification made with NotificationCompat.Builder mBuilder and it cancels fine when passing .setAutoCancel(true); to it, but I want it to cancel when also clicking on one of the given buttons with .addAction(R.drawable.ic_launcher, "Ignore", pIntent2) , currently it does not cancel, how can I do it?

Upvotes: 0

Views: 71

Answers (1)

Shailendra Madda
Shailendra Madda

Reputation: 21561

To clear a particular Notification you can do it like,

notificationManager.cancel(notification_id);

Upvotes: 2

Related Questions