To display the 3 lines of text plus the text "info" you have to do this:
Notification notif = new NotificationCompat.Builder(this)
.setContentTitle("Title")
.setContentText("Text")
.setSubText("SubText")
.setContentInfo("info")
When setting BigPictureStyle like this:
NotificationCompat.BigPictureStyle big = new NotificationCompat.BigPictureStyle();
big.bigPicture(bitMap)
.setBigContentTitle("BIG TITLE")
.setSummaryText("SUMMARY");
When Notification is displayed expanded:
- "Title" is replaced by "BIG TITLE"
- the text "Text" is retained.
- the text "SubText" is replaced by "SUMMARY"
It is also possible to create custom notifications using a RemoteViews and pass it to the Notification.Builder% method
Set your layout as usual in xml , then build the Notification this way:
RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.customnotification);
Notification.Builder builder = new Notification.Builder(this)
...
...
...
.setContent(remoteViews);
Use the various methods provided by RemoteViews to access the views of the layout .
For example setContent()
assigns a pendingIntent to the remoteViews.setOnClickPendingIntent(R.id.button1, intent);