Notification.Builder和FLAG_INSISTENT [英] Notification.Builder and FLAG_INSISTENT
问题描述
我喜欢的易用性 Notification.Builder
的,但它似乎不支持通知的迫切模式。
I like the ease of use of Notification.Builder
but it seems not support the insistent mode of notifications.
有没有一种方法来设置标志 FLAG_INSISTENT
从 Notification.Builder
?
Is there a way to set the flag FLAG_INSISTENT
from the Notification.Builder
?
推荐答案
不直接。有关于 Notification.Builder
私人 setFlag()
方法 - 我不知道为什么他们没有暴露
Not directly. There is a private setFlag()
method on Notification.Builder
-- I do not know why they did not expose it.
不过,您可以配置通知的其余部分
通过生成器
,然后调整已完成的标志通知
对象。
However, you can configure the rest of the Notification
via a Builder
, then adjust the flags on the completed Notification
object.
或者,抢$ C $下 Notification.Builder
并修改它来创建自己的暴露 setFlag()
,或者增加 setInsistent()
等。
Or, grab the code for Notification.Builder
and modify it to create your own that exposes setFlag()
, or adds setInsistent()
, etc.
这篇关于Notification.Builder和FLAG_INSISTENT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!