NotificationCompat

public class NotificationCompat
extends Object

java.lang.Object
   ↳ androidx.core.app.NotificationCompat


Helper for accessing features in Notification.

Summary

Nested classes

class NotificationCompat.Action

Structure to encapsulate a named action that can be shown as part of this notification. 

class NotificationCompat.BigPictureStyle

Helper class for generating large-format notifications that include a large image attachment. 

class NotificationCompat.BigTextStyle

Helper class for generating large-format notifications that include a lot of text. 

class NotificationCompat.BubbleMetadata

Encapsulates the information needed to display a notification as a bubble. 

class NotificationCompat.Builder

Builder class for NotificationCompat objects. 

class NotificationCompat.CarExtender

Helper class to add Android Auto extensions to notifications. 

class NotificationCompat.DecoratedCustomViewStyle

Notification style for custom views that are decorated by the system. 

interface NotificationCompat.Extender

Extender interface for use with NotificationCompat.Builder.extend(NotificationCompat.Extender)

class NotificationCompat.InboxStyle

Helper class for generating large-format notifications that include a list of (up to 5) strings. 

class NotificationCompat.MessagingStyle

Helper class for generating large-format notifications that include multiple back-and-forth messages of varying types between any number of people. 

class NotificationCompat.Style

An object that can apply a rich notification style to a Notification.CarExtender.Builder object. 

class NotificationCompat.WearableExtender

Helper class to add wearable extensions to notifications. 

Constants

int BADGE_ICON_LARGE

If this notification is being shown as a badge, use the icon provided to NotificationCompat.Builder.setLargeIcon(Bitmap) to represent this notification.

int BADGE_ICON_NONE

If this notification is being shown as a badge, always show as a number.

int BADGE_ICON_SMALL

If this notification is being shown as a badge, use the icon provided to NotificationCompat.Builder.setSmallIcon(int) to represent this notification.

String CATEGORY_ALARM

Notification category: alarm or timer.

String CATEGORY_CALL

Notification category: incoming call (voice or video) or similar synchronous communication request.

String CATEGORY_EMAIL

Notification category: asynchronous bulk message (email).

String CATEGORY_ERROR

Notification category: error in background operation or authentication status.

String CATEGORY_EVENT

Notification category: calendar event.

String CATEGORY_LOCATION_SHARING

Notification category: temporarily sharing location.

String CATEGORY_MESSAGE

Notification category: incoming direct message (SMS, instant message, etc.).

String CATEGORY_MISSED_CALL

Notification category: missed call.

String CATEGORY_NAVIGATION

Notification category: map turn-by-turn navigation.

String CATEGORY_PROGRESS

Notification category: progress of a long-running background operation.

String CATEGORY_PROMO

Notification category: promotion or advertisement.

String CATEGORY_RECOMMENDATION

Notification category: a specific, timely recommendation for a single thing.

String CATEGORY_REMINDER

Notification category: user-scheduled reminder.

String CATEGORY_SERVICE

Notification category: indication of running background service.

String CATEGORY_SOCIAL

Notification category: social network or sharing update.

String CATEGORY_STATUS

Notification category: ongoing information about device or contextual status.

String CATEGORY_STOPWATCH

Notification category: running stopwatch.

String CATEGORY_SYSTEM

Notification category: system or device status update.

String CATEGORY_TRANSPORT

Notification category: media transport control for playback.

String CATEGORY_WORKOUT

Notification category: tracking a user's workout.

int COLOR_DEFAULT

Value of Notification.color equal to 0 (also known as Color.TRANSPARENT), telling the system not to decorate this notification with any special color but instead use default colors when presenting this notification.

int DEFAULT_ALL

Use all default values (where applicable).

int DEFAULT_LIGHTS

Use the default notification lights.

int DEFAULT_SOUND

Use the default notification sound.

int DEFAULT_VIBRATE

Use the default notification vibrate.

String EXTRA_AUDIO_CONTENTS_URI

Keys into the getExtras(Notification) Bundle: the audio contents of this notification.

String EXTRA_BACKGROUND_IMAGE_URI

extras key: A content URI pointing to an image that can be displayed in the background when the notification is selected.

String EXTRA_BIG_TEXT

extras key: this is the longer text shown in the big form of a NotificationCompat.BigTextStyle notification, as supplied to NotificationCompat.BigTextStyle.bigText(CharSequence).

String EXTRA_CHANNEL_GROUP_ID

Optional extra for INTENT_CATEGORY_NOTIFICATION_PREFERENCES.

String EXTRA_CHANNEL_ID

Optional extra for INTENT_CATEGORY_NOTIFICATION_PREFERENCES.

String EXTRA_CHRONOMETER_COUNT_DOWN

extras key: whether the chronometer set on the notification should count down instead of counting up.

String EXTRA_COLORIZED

extras key: whether the notification should be colorized as supplied to NotificationCompat.Builder.setColorized(boolean).

String EXTRA_COMPACT_ACTIONS

extras key: the indices of actions to be shown in the compact view, as supplied to (e.g.) Notification.MediaStyle.setShowActionsInCompactView(int).

String EXTRA_COMPAT_TEMPLATE

extras key: A string representing the name of the specific NotificationCompat.Style used to create this notification.

String EXTRA_CONVERSATION_TITLE

extras key: a String to be displayed as the title to a conversation represented by a NotificationCompat.MessagingStyle.

String EXTRA_HIDDEN_CONVERSATION_TITLE

Key for compat's NotificationCompat.MessagingStyle.getConversationTitle().

String EXTRA_HISTORIC_MESSAGES

extras key: an array of historic NotificationCompat.MessagingStyle.Message bundles provided by a NotificationCompat.MessagingStyle notification.

String EXTRA_INFO_TEXT

extras key: this is a small piece of additional text as supplied to NotificationCompat.Builder.setContentInfo(CharSequence).

String EXTRA_IS_GROUP_CONVERSATION

extras key: whether the NotificationCompat.MessagingStyle notification represents a group conversation.

String EXTRA_LARGE_ICON

extras key: this is a bitmap to be used instead of the small icon when showing the notification payload, as supplied to NotificationCompat.Builder.setLargeIcon(android.graphics.Bitmap).

String EXTRA_LARGE_ICON_BIG

extras key: this is a bitmap to be used instead of the one from NotificationCompat.Builder.setLargeIcon(android.graphics.Bitmap) when the notification is shown in its expanded form, as supplied to NotificationCompat.BigPictureStyle.bigLargeIcon(android.graphics.Bitmap).

String EXTRA_MEDIA_SESSION

Notification key: A MediaSession.Token associated with a Notification.MediaStyle notification.

String EXTRA_MESSAGES

extras key: an array of NotificationCompat.MessagingStyle.Message bundles provided by a Notification.MessagingStyle notification.

String EXTRA_MESSAGING_STYLE_USER

extras key: the person to display for all messages sent by the user, including direct replies to NotificationCompat.MessagingStyle notifications.

String EXTRA_NOTIFICATION_ID

Optional extra for INTENT_CATEGORY_NOTIFICATION_PREFERENCES.

String EXTRA_NOTIFICATION_TAG

Optional extra for INTENT_CATEGORY_NOTIFICATION_PREFERENCES.

String EXTRA_PEOPLE

This constant is deprecated. the actual objects are now in EXTRA_PEOPLE_LIST

String EXTRA_PEOPLE_LIST

extras key: : An arrayList of Person objects containing the people that this notification relates to, each of which was supplied to NotificationCompat.Builder.addPerson(Person).

String EXTRA_PICTURE

extras key: this is a bitmap to be shown in NotificationCompat.BigPictureStyle expanded notifications, supplied to NotificationCompat.BigPictureStyle.bigPicture(android.graphics.Bitmap).

String EXTRA_PROGRESS

extras key: this is the progress value supplied to NotificationCompat.Builder.setProgress(int, int, boolean).

String EXTRA_PROGRESS_INDETERMINATE

extras key: whether the progress bar is indeterminate, supplied to NotificationCompat.Builder.setProgress(int, int, boolean).

String EXTRA_PROGRESS_MAX

extras key: this is the maximum value supplied to NotificationCompat.Builder.setProgress(int, int, boolean).

String EXTRA_REMOTE_INPUT_HISTORY

extras key: this is the remote input history, as supplied to NotificationCompat.Builder.setRemoteInputHistory(CharSequence[]).

String EXTRA_SELF_DISPLAY_NAME

extras key: the username to be displayed for all messages sent by the user including direct replies NotificationCompat.MessagingStyle notification.

String EXTRA_SHOW_BIG_PICTURE_WHEN_COLLAPSED

extras key: this is a boolean to indicate that the big picture is to be shown in the collapsed state of a NotificationCompat.BigPictureStyle notification.

String EXTRA_SHOW_CHRONOMETER

extras key: whether the when field set using NotificationCompat.Builder.setWhen(long) should be shown as a count-up timer (specifically a Chronometer) instead of a timestamp, as supplied to NotificationCompat.Builder.setUsesChronometer(boolean).

String EXTRA_SHOW_WHEN

extras key: whether the when field set using NotificationCompat.Builder.setWhen(long) should be shown, as supplied to NotificationCompat.Builder.setShowWhen(boolean).

String EXTRA_SMALL_ICON

extras key: this is the resource ID of the notification's main small icon, as supplied to NotificationCompat.Builder.setSmallIcon(int).

String EXTRA_SUB_TEXT

extras key: this is a third line of text, as supplied to NotificationCompat.Builder.setSubText(CharSequence).

String EXTRA_SUMMARY_TEXT

extras key: this is a line of summary information intended to be shown alongside expanded notifications, as supplied to (e.g.) NotificationCompat.BigTextStyle.setSummaryText(CharSequence).

String EXTRA_TEMPLATE

extras key: A string representing the name of the specific Notification.Style used to create this notification.

String EXTRA_TEXT

extras key: this is the main text payload, as supplied to NotificationCompat.Builder.setContentText(CharSequence).

String EXTRA_TEXT_LINES

extras key: An array of CharSequences to show in NotificationCompat.InboxStyle expanded notifications, each of which was supplied to NotificationCompat.InboxStyle.addLine(CharSequence).

String EXTRA_TITLE

extras key: this is the title of the notification, as supplied to NotificationCompat.Builder.setContentTitle(CharSequence).

String EXTRA_TITLE_BIG

extras key: this is the title of the notification when shown in expanded form, e.g.

int FLAG_AUTO_CANCEL

Bit set in the Notification flags field if the notification should be canceled when it is clicked by the user.

int FLAG_BUBBLE

Bit set in the Notification flags field if this notification is showing as a bubble.

int FLAG_FOREGROUND_SERVICE

Bit set in the Notification flags field if this notification represents a currently running service.

int FLAG_GROUP_SUMMARY

Bit set in the Notification flags field if this notification is the group summary for a group of notifications.

int FLAG_HIGH_PRIORITY

This constant is deprecated. Use NotificationCompat.Builder.setPriority(int) with a positive value.

int FLAG_INSISTENT

Bit set in the Notification flags field if the audio will be repeated until the notification is cancelled or the notification window is opened.

int FLAG_LOCAL_ONLY

Bit set in the Notification flags field if this notification is relevant to the current device only and it is not recommended that it bridge to other devices.

int FLAG_NO_CLEAR

Bit set in the Notification flags field if the notification should not be canceled when the user clicks the Clear all button.

int FLAG_ONGOING_EVENT

Bit set in the Notification flags field if this notification is in reference to something that is ongoing, like a phone call.