On Android 6 I'm trying to display a notification with the following combination of properties:
- text title and content
- expandable image content (see here and here)
- don't show a notification icon in the status bar (don't want to clutter it up)
- don't flash any LEDs (don't want to trouble user)
- show on lockscreen
- show on lockscreen in expanded (or at least expandable) format (showing the bigContentView)
I can achieve 3 and 4 by setPriority(Notification.PRIORITY_MIN)
but then the notification doesn't seem to show on the lock screen at all (fail on 5).
As for 6, when the notification does shown on the lockscreen e.g. using PRIORITY_MAX
(passing on 5 but failing on 3 and 4), it is not expanded or even expandable (failing on 6).
I'm using the following to set up the notification:
Notification notification = new NotificationCompat.Builder(context)
.setContentTitle(titleText)
.setContentText(contentText)
.setSmallIcon(R.drawable.small_icon)
.setOngoing(true)
.setPriority(Notification.PRIORITY_DEFAULT)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.build();
// add the image content (via a remoteViews)...
notification.bigContentView = remoteViews;
notificationManager.notify(tag, id, notification);