Does Android provide a callback when the clear button on notifications list is clicked

偶尔善良 提交于 2019-12-22 12:37:10

问题


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 ?


回答1:


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

public PendingIntent deleteIntent

Since: API Level 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.



来源:https://stackoverflow.com/questions/3956774/does-android-provide-a-callback-when-the-clear-button-on-notifications-list-is-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!