如何从状态栏中删除通知?
我根据我的情况在状态栏中显示通知
。到此为止,就OK了。
现在我的应用程序中的问题是当我返回应用程序时,状态栏中仍然显示通知
。
当我从应用程序返回时,我不希望收到通知
。为此给我一些建议。
I am displaying a Notification
in status bar depending up on my condition. Up to this, it is OK.
Now problem in my application is when I come back to application, still the Notification
is displayed in the status bar.
I don't want the Notification
when I come back from the application. For this give me some suggestions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我没有足够的代表来添加评论,所以 @Commonware 。 。 。如果您提供更具体的细节(例如告诉他们使用
“通知 ID”,当他们创建通知并使用该 ID 取消通知时。
如果您给出答案,请使其完整或至少提供完整的详细信息。这些帖子不仅适用于 OP,还可以帮助其他遇到这篇文章的人。
像这样
然后取消它你打电话
或者你可以打电话
I don't have enough rep to add comment so @Commonware . . . it would be more helpful to future readers if you gave more specific details like telling them to use a
"notification id" when they create the notification and use that ID to cancel the notification.
If you give an answer make it complete or at least provide the full details. These posts are not only meant for the OP it helps others who come across this post as well.
like so
Then to cancel it you call
or you can call
您可以通过
NotificationManager
cancel()
自己的通知
。由您决定何时cancel()
它以及何时显示它。You can
cancel()
your ownNotifications
via theNotificationManager
. It is up to you to decide when tocancel()
it and when to show it.