Show android notification action buttons expanded by default

11.3k Views Asked by At

Is there a way to show action buttons in notification expanded by default? I use ongoing notification to control traning process in my app. I want controling buttons such as "Stop" and "Pause" to be visible right after notification appeared in the notification area.

Collapsed buttons by default

Want the buttons to be expanded

2

There are 2 best solutions below

4
On BEST ANSWER

You can't expand notification. The only solution is, set Priority Max, then the top of the notification list where it would be expanded. And it depends on the device as well.

mBuilder.setPriority(Notification.PRIORITY_HIGH)
0
On

I am working on project . There is same requirement come . I searched online . And i found a solution , i just add few line in my notification it work.

notification.priority = NotificationCompat.PRIORITY_MAX
notification.setStyle(NotificationCompat.BigTextStyle())