如何清除状态栏上的推送通知警报 - android [英] How to clear Push notification alert on status bar - android

查看:21
本文介绍了如何清除状态栏上的推送通知警报 - android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 Android 应用中使用了 parse 推送通知.

Hi i've used parse push notification in my android app.

我没有使用 noraml 通知.我已经注册了解析推送通知.通知警报来自服务器

i'm not using noraml notification. i've register parse push notification. The notification alert comes from server

设备成功收到推送通知.

device received the push notification successfully.

例如,我收到了来自服务器的 10 条通知,如果我在我的设备上打开一条通知,则该应用程序已打开,而一条通知已被删除.

for example i've received 10 notification from server, if i open one notification on my device, the app has opened and the one notification has deleted.

我的问题是,

如何在打开一个通知时清除状态栏上的其他 9 个推送通知警报..?

推荐答案

android.app.NotificationManager.cancelAll() 不工作吗?

Does android.app.NotificationManager.cancelAll() not work?

如果你需要做一些非常自定义的事情,你可以使用 ParsePush 来启动一个 Intent 而不是创建一个通知.然后,您可以使用 BroadcastReceiver 创建具有非标准行为的通知(即选择性堆叠、在与之交互时关闭所有通知等).

If you need to do something very custom, you can use ParsePush to launch an Intent rather than creating a Notification. You can then use a BroadcastReceiver to create Notifications with non-standard behavior (i.e. selective stacking, dismiss all when one is interacted with, etc).

这篇关于如何清除状态栏上的推送通知警报 - android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆