Skip to content
Advertisement

How to show Heads up notifications android

How to get a heads up notification.With below code i can only see three dots on status bar and a notification in notification bar.

JavaScript

Advertisement

Answer

I was having the same problem, but I was using the newer NotificationCompat.Builder() call which requires a channel ID from a NotificationChannel.

The notification will only appear as a heads-up notification if the NotificationChannel is created with an importance value of NotificationManager.IMPORTANCE_HIGH:

JavaScript

Show the heads-up notification:

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