如何知道什么时候我通知经清除按钮清除? [英] How to know when my notification is cleared via Clear button?

查看:117
本文介绍了如何知道什么时候我通知经清除按钮清除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个通知,并增加了一个 PendingIntent ,这样,当展开视图中选择通知的通知被关闭。

I have created a notification and added a PendingIntent so that the notification is closed when the notification is selected in expanded view.

我的问题是,当用户点击清除按钮删除我不会通知所有通知,我需要执行的时候我通知被杀害了一些清理工作。

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 将使我忽略清除按钮并保持我的通知,但我倒是preFER有我的意图触发正确的,让清理工作。

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.

推荐答案

好像你正在寻找的<一个href="http://developer.android.com/reference/android/app/Notification.html#deleteIntent">deleteIntent字段的<一href="http://developer.android.com/reference/android/app/Notification.html"><$c$c>Notification类。

It seems like you are looking for the deleteIntent field of the Notification class.

这篇关于如何知道什么时候我通知经清除按钮清除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆