如何向通知(状态栏通知)添加标志?
我正在遵循开发人员指南中的教程,但我遇到了问题...
教程说:“要在用户从通知窗口中选择状态栏通知时清除状态栏通知,请将“FLAG_AUTO_CANCEL”标志添加到您的通知对象中”
但是...如何将标志添加到我的通知中?
notification 没有任何类型的功能来添加标志......那么?我怎样才能做到呢?
im following the tutorial from developers guide but i have a problem...
tutorial says: "To clear the status bar notification when the user selects it from the Notifications window, add the "FLAG_AUTO_CANCEL" flag to your Notification object"
but... how i can add the flag to my notification?
notification doesn't have any kind of function to add flags.... then? how i can do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
通知标志是公共成员字段。
Notification flags is a public member field.
当您定义 Intent 时,标志会出现在末尾,如下所示:
Flags go on the end when you define the Intent, like this:
下面是您可以尝试的代码,它的工作原理。
Below is the code you can try, Its working.