当点击通知列表上的清除按钮时Android是否提供回调
当点击通知列表上的清除按钮时,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 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在通知对象中设置一个
deleteIntent
。但还没玩过。public PendingIntent deleteIntent
自:API 级别 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.