android - 通知维护方式的差异

标签 android notifications

FLAG_ONGOING_EVENT 函数和 FLAG_NO_CLEAR 函数有什么区别?它们如何使 Notification 表现不同?他们是否都使通知永久化。

最佳答案

文档说:

FLAG_ONGOING_EVENT: Bit to be bitwise-ored into the flags field that should be set if this notification is in reference to something that is ongoing, like a phone call. It should not be set if this notification is in reference to something that happened at a particular point in time, like a missed phone call.

FLAG_NO_CLEAR :Bit to be bitwise-ored into the flags field that should be set if the notification should not be canceled when the user clicks the Clear all button.

我认为在这些词中它们有不同的含义,所以混合这些标志会给你一个永久的通知,直到你的程序进程结束,如果你只使用 FLAG_ONGOING_EVENT 这会导致你的通知运行直到你的绑定(bind)服务(如电话)结束并且它也是可取消的由开发人员或它可以由用户清除,当您将它与另一个混合时,用户无法从状态栏中清除它。

关于android - 通知维护方式的差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18246775/

相关文章:

android - 状态栏图标颜色不随主题改变

javascript - jQuery 通知插件

android - 在android中两个位置之间的 map 上查找路线

android - 如何查询屏幕固定设置?

android - APDU 写命令导致 6A 81

java - webView的scrollTo始终不工作

android - 捕获滑动以关闭事件

android - 如何从另一个应用程序的通知中获取图像?

Android - 从互联网下载数据 >> 捕获连接错误

java - 按下音量按钮时如何使通知静音?