Android:状态栏中的组通知但不在通知列表中 [英] Android: Group notification in status bar but not in notifications list

查看:14
本文介绍了Android:状态栏中的组通知但不在通知列表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道是否有办法将状态栏中的通知分组而不是通知列表中的通知?

Does anyone know if there is a way to group a notification in the status bar but not in the list of notifications?

我只想在状态栏中显示一个图标,但是当用户向下拖动通知列表"时,它应该是多个具有不同意图的通知.

I want to show only one icon in the status bar but when the user drags down the "notifications list" it should be several notifications with different intents.

据我所知,只能在两个位置对两个通知进行分组,或者创建多个通知,这将在状态栏中导致多个通知.是这样吗?

As I understood there is only possible to either group both notifications on both places or to create several notifications which will cause several notifications in the status bar. Is this the case?

推荐答案

正如我所理解的那样,只能将两个地方的两个通知分组或创建多个通知将在状态栏中引起多个通知.是这样吗?

As I undestood there is only possible to either group both notifications on both places or to create several notifications which will cause several notifications in the status bar. Is this the case?

是的,但您可以创建复杂的自定义 Notification 根据需要查看,通过 Notification 上的 contentView 字段.这是一个 RemoteViews,更广为人知的是您用于呈现主屏幕应用程序小部件的内容.因此,虽然通知抽屉中只能有一个条目供您使用,但您可以让它有多个按钮,每个按钮触发一个单独的 PendingIntent.

Yes, but you can create as complex of a custom Notification view as you want, via the contentView field on Notification. This is a RemoteViews, better known as the what you use for rendering a home screen app widget. So, while there can only be one entry in the notification drawer for you, you can have it have several buttons each firing a separate PendingIntent.

这篇关于Android:状态栏中的组通知但不在通知列表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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