如何通过清除按钮知道我的通知何时被清除? [英] How to know when my notification is cleared via Clear button?
问题描述
我创建了一个通知并添加了一个 PendingIntent
以便在展开视图中选择通知时关闭通知.
I have created a notification and added a PendingIntent
so that the notification is closed when the notification is selected in expanded view.
我的问题是,当用户点击 Clear
按钮删除所有通知时,我没有收到通知,当我的通知被终止时,我需要执行一些清理.
My problem is that when the user clicks the Clear
button to remove all notifications I am not notified and I need to perform some cleanup when my notification is killed.
FLAG_NO_CLEAR
将使我能够忽略 Clear
按钮并保留我的通知,但我更希望我的 Intent
正确触发以允许清理.
FLAG_NO_CLEAR
would enable me to ignore the Clear
button and keep my notification but I'd prefer to have my Intent
triggered correctly to allow cleanup.
推荐答案
您似乎正在寻找 deleteIntent 字段 通知
类.
It seems like you are looking for the deleteIntent field of the Notification
class.
这篇关于如何通过清除按钮知道我的通知何时被清除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!