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/