I'd like to know how to create a notification that doesn't show the icon in the statusbar.
There is a way to hide it?
How do I hide the status bar on Android? With a stock Android phone, press and hold Settings until System Settings appears. Select System UI Tuner > Status Bar, and turn off all the options.
Once you're in the app settings, you'll notice the “Notifications” submenu. Open it. There you'll see a ton of notification options on a system level. You can basically choose to minimize status bar notifications for one particular type of notification.
To customize it, first pull down the slider bar from the top of the screen. Next, tap on the three vertical dots in the top right corner. Now click on Status bar. You're in.
Since Android 4.1 (API level 16) it's possible to specify a notification's priority
. If you set that flag to PRIORITY_MIN
the notification icon won't show up on the statusbar.
notification.priority = Notification.PRIORITY_MIN;
Or in case you use a Notification.Builder
:
builder.setPriority(Notification.PRIORITY_MIN);
As of Android 8.0 Oreo (API level 26) you have to set the importance
of the notification's NotificationChannel
to IMPORTANCE_MIN
:
NotificationChannel channel =
new NotificationChannel(channelId, channelName, NotificationManager.IMPORTANCE_MIN);
notificationManager.createNotificationChannel(channel);
...
builder.setChannelId(channel.getId())
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