Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Group notification in status bar but not in notifications list

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?

like image 266
likebobby Avatar asked Feb 26 '23 05:02

likebobby


1 Answers

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?

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.

like image 60
CommonsWare Avatar answered Apr 29 '23 02:04

CommonsWare