Android版是否提供了一个回调点击通知列表中清除按钮时,回调、按钮、通知、列表中

2023-09-06 06:08:19 作者:别动我的辣条

是否提供Android的通知名单上的清除按钮被点击时的回调?我的应用程序需要明确每当通知被点击或清除一些数据。在点击我知道该怎么做,但我要如何处理第二个情况?

Does Android provide a callback when the clear button on the notification list is clicked ? My app needs to clear some data whenever the notification is clicked or cleared. On clicking I know what to do, but how do I handle the second case ?

推荐答案

您可以在通知对象设置了 deleteIntent 。但没有发挥它呢。

You can set a deleteIntent in the notification object. But haven't played with it yet.

公开的PendingIntent deleteIntent

public PendingIntent deleteIntent

自:API等级1

当状态条目由与全部清除通知按钮,用户删除的意图来执行。这大概不应该推出一些,因为这些将在同一时间发送的活动。

The intent to execute when the status entry is deleted by the user with the "Clear All Notifications" button. This probably shouldn't be launching an activity since several of those will be sent at the same time.