Skip to content
Advertisement

NotificationCompat – how to add action without icon?

JavaScript

Above code creates notification and adds one action (button) to it. I want my button to be without icon displayed, but I don’t know how to do that, because icon in parameter addAction is required and not nullable.

Is it even possible to add action button to notification without any icon (btw, icons on action buttons seems to be not even shown on Nougat an Oreo).

Advertisement

Answer

Use NotificationCompat.Action instead. And set 0 as the value for icon

JavaScript

Worked all the devices as far I have tested

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement