I have a notification that contains an action like this:

The action is always shown, I'd like to hide it by default so the user has to press the button at the top right to show the action so that the notification occupies less space.
I've read about using a low notification priority by calling setPriority on the NotificationCompat.Builder before posting the ongoing notification from my foreground service, but this doesn't seem to work. I'm using Android SDK version 28.
Starting from API 26, using PRIORITY_LOW is deprecated, instead you can use IMPORTANCE_LOW when you create the channel
NotificationChannel channel = new NotificationChannel(CHANNEL_ID,
CHANNEL_NAME, NotificationManager.IMPORTANCE_LOW);
Also keep the low priority in the NotificationCompat.Builder with builder.setPriority(NotificationCompat.PRIORITY_LOW)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With