These are 2 notifications on Android 7+:
- in the top line, this one presents: the icon, the app name, an extra text (in the case of Gmail is the account email address), and the time
Can anyone explain how to include the extra text between the app name and the notification time, as shown in the Gmail notification?
Is there a method of NotificationCompat.Builder
to set that text?
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, NotificationChannels.TRIPS_CHANNEL_ID)
.setSmallIcon(ICON_DRAWABLE)
.setColor(TITLE_COLOR)
.setContentTitle(FIRST_LINE_TEXT) // "Remote input"
.setContentText(SECOND_LINE_TEXT); // "Try typing some text!"