I have a notification, presented using the following code:
// Create the notification
android.app.Notification systemNotification = new NotificationCompat.Builder(context)
// Set notification data and appearance
.setContentTitle(notification.getNotificationLabel())
.setContentText(notification.getMessage())
.setSmallIcon(notification.getNotificationDrawable())
.setWhen(new Date().getTime())
// Set notification options
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setDefaults(NotificationCompat.DEFAULT_ALL)
.build()
;
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(notification.getNotificationId(), systemNotification);
When run on Lollypop and newer, it works fine and the notification appears both in the status bar and as a popup notification as expected/desired. On Kitkat, the notification only appears in the status bar, there's no popup notification. I can still open the notification from the status bar and everything looks and works fine, it's just the popup notification that's missing.
Some of the things I've tried so far:
- different options to
setDefaults
- different options to
setPriority
- verified that notifications are on in the system settings panel for the application