NotificationCompat

Added in 1.1.0

public class NotificationCompat


Helper for accessing features in android.app.Notification.

Summary

Nested types

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

Builder class for Action objects.

Extender interface for use with extend.

Provides meaning to an Action that hints at what the associated PendingIntent will do.

Wearable extender for notification actions.

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

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

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

Builder to construct a BubbleMetadata object.

Builder class for NotificationCompat objects.

Helper class for generating large-format notifications that include a caller and required actions, and indicate an incoming call.

Helper class to add Android Auto extensions to notifications.

This class is deprecated.

UnreadConversation is no longer supported.

Builder class for CarExtender.UnreadConversation objects.

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

Extender interface for use with extend.

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

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

Helper class for generating large-format notifications that display progress to the user with a highly customizable progress bar with segments, points, a custom tracker icon, and custom icons at the start and end of the progress bar.

A point within the progress bar, defining its position and color.

A segment of the progress bar, which defines its length and color.

public abstract class NotificationCompat.Style

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

Helper class to add Android TV extensions to notifications.

Helper class to add wearable extensions to notifications.

Constants

static final int

If this notification is being shown as a badge, use the icon provided to setLargeIcon to represent this notification.

static final int

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

static final int

If this notification is being shown as a badge, use the icon provided to setSmallIcon to represent this notification.

static final String
CATEGORY_ALARM = "alarm"

Notification category: alarm or timer.

static final String
CATEGORY_CALL = "call"

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

static final String
CATEGORY_EMAIL = "email"

Notification category: asynchronous bulk message (email).

static final String

Notification category: error in background operation or authentication status.

static final String
CATEGORY_EVENT = "event"

Notification category: calendar event.

static final String
CATEGORY_LOCATION_SHARING = "location_sharing"

Notification category: temporarily sharing location.

static final String

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

static final String
CATEGORY_MISSED_CALL = "missed_call"

Notification category: missed call.

static final String
CATEGORY_NAVIGATION = "navigation"

Notification category: map turn-by-turn navigation.

static final String
CATEGORY_PROGRESS = "progress"

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

static final String
CATEGORY_PROMO = "promo"

Notification category: promotion or advertisement.

static final String
CATEGORY_RECOMMENDATION = "recommendation"

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

static final String
CATEGORY_REMINDER = "reminder"

Notification category: user-scheduled reminder.

static final String
CATEGORY_SERVICE = "service"

Notification category: indication of running background service.

static final String
CATEGORY_SOCIAL = "social"

Notification category: social network or sharing update.

static final String
CATEGORY_STATUS = "status"

Notification category: ongoing information about device or contextual status.

static final String
CATEGORY_STOPWATCH = "stopwatch"

Notification category: running stopwatch.

static final String

Notification category: system or device status update.

static final String
CATEGORY_TRANSPORT = "transport"

Notification category: media transport control for playback.

static final String
CATEGORY_VOICEMAIL = "voicemail"

Notification category: voicemail.

static final String
CATEGORY_WORKOUT = "workout"

Notification category: tracking a user's workout.

static final @ColorInt int

Value of 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.

static final int

Use all default values (where applicable).

static final int

Use the default notification lights.

static final int

Use the default notification sound.

static final int

Use the default notification vibrate.

static final String
EXTRA_ANSWER_COLOR = "android.answerColor"

extras key: the color used as a hint for the Answer action button of a android.app.Notification.CallStyle notification.

static final String
EXTRA_ANSWER_INTENT = "android.answerIntent"

extras key: the intent to be sent when the users answers a android.app.Notification.CallStyle notification.

static final String
EXTRA_AUDIO_CONTENTS_URI = "android.audioContents"

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

static final String
EXTRA_BACKGROUND_IMAGE_URI = "android.backgroundImageUri"

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

static final String
EXTRA_BIG_TEXT = "android.bigText"

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

static final String
EXTRA_CALL_IS_VIDEO = "android.callIsVideo"

extras key: whether the android.app.Notification.CallStyle notification is for a call that will activate video when answered.

static final String
EXTRA_CALL_PERSON = "android.callPerson"

extras key: the person to be displayed as calling for the android.app.Notification.CallStyle notification.

static final String
EXTRA_CALL_PERSON_COMPAT = "android.callPersonCompat"

extras key: the person to be displayed as calling for the android.app.Notification.CallStyle notification, for Android versions before the Person class was introduced.

static final String
EXTRA_CALL_TYPE = "android.callType"

extras key: the type of call represented by the android.app.Notification.CallStyle notification.

static final String
EXTRA_CHANNEL_GROUP_ID = "android.intent.extra.CHANNEL_GROUP_ID"

Optional extra for INTENT_CATEGORY_NOTIFICATION_PREFERENCES.

static final String
EXTRA_CHANNEL_ID = "android.intent.extra.CHANNEL_ID"

Optional extra for INTENT_CATEGORY_NOTIFICATION_PREFERENCES.

static final String
EXTRA_CHRONOMETER_COUNT_DOWN = "android.chronometerCountDown"

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

static final String
EXTRA_COLORIZED = "android.colorized"

extras key: whether the notification should be colorized as supplied to setColorized.

static final String
EXTRA_COMPACT_ACTIONS = "android.compactActions"

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

static final String
EXTRA_COMPAT_TEMPLATE = "androidx.core.app.extra.COMPAT_TEMPLATE"

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

static final String
EXTRA_CONVERSATION_TITLE = "android.conversationTitle"

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

static final String
EXTRA_DECLINE_COLOR = "android.declineColor"

extras key: the color used as a hint for the Decline or Hang Up action button of a android.app.Notification.CallStyle notification.

static final String
EXTRA_DECLINE_INTENT = "android.declineIntent"

extras key: the intent to be sent when the users declines a android.app.Notification.CallStyle notification.

static final String
EXTRA_HANG_UP_INTENT = "android.hangUpIntent"

extras key: the intent to be sent when the users hangs up a android.app.Notification.CallStyle notification.

static final String
EXTRA_HIDDEN_CONVERSATION_TITLE = "android.hiddenConversationTitle"

Key for compat's getConversationTitle.

static final String
EXTRA_HISTORIC_MESSAGES = "android.messages.historic"

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

static final String
EXTRA_INFO_TEXT = "android.infoText"

extras key: this is a small piece of additional text as supplied to setContentInfo.

static final String
EXTRA_IS_GROUP_CONVERSATION = "android.isGroupConversation"

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

static final String
EXTRA_LARGE_ICON = "android.largeIcon"

extras key: this is a bitmap to be used instead of the small icon when showing the notification payload, as supplied to setLargeIcon.

static final String
EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"

extras key: this is a bitmap to be used instead of the one from setLargeIcon when the notification is shown in its expanded form, as supplied to bigLargeIcon.

static final String
EXTRA_MEDIA_SESSION = "android.mediaSession"

Notification key: A android.media.session.MediaSession.Token associated with a android.app.Notification.MediaStyle notification.

static final String
EXTRA_MESSAGES = "android.messages"

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

static final String
EXTRA_MESSAGING_STYLE_USER = "android.messagingStyleUser"

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

static final String
EXTRA_NOTIFICATION_ID = "android.intent.extra.NOTIFICATION_ID"

Optional extra for INTENT_CATEGORY_NOTIFICATION_PREFERENCES.

static final String
EXTRA_NOTIFICATION_TAG = "android.intent.extra.NOTIFICATION_TAG"

Optional extra for INTENT_CATEGORY_NOTIFICATION_PREFERENCES.

static final String
EXTRA_PEOPLE = "android.people"

This field is deprecated.

the actual objects are now in EXTRA_PEOPLE_LIST

static final String
EXTRA_PEOPLE_LIST = "android.people.list"

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

static final String
EXTRA_PICTURE = "android.picture"

extras key: this is a bitmap to be shown in BigPictureStyle expanded notifications, supplied to bigPicture.

static final String
EXTRA_PICTURE_CONTENT_DESCRIPTION = "android.pictureContentDescription"

extras key: this is a content description of the big picture supplied from bigPicture, supplied to setContentDescription.

static final String
EXTRA_PICTURE_ICON = "android.pictureIcon"

extras key: this is an Icon of an image to be shown in Notification.BigPictureStyle expanded notifications, supplied to bigPicture.

static final String
EXTRA_PROGRESS = "android.progress"

extras key: this is the progress value supplied to setProgress.

static final String
EXTRA_PROGRESS_END_ICON = "android.progressEndIcon"

extras key: this is an IconCompat of an image to be shown at the end of the progress bar in ProgressStyle, supplied to setProgressEndIcon.

static final String
EXTRA_PROGRESS_INDETERMINATE = "android.progressIndeterminate"

extras key: whether the progress bar is indeterminate, supplied to setProgress.

static final String
EXTRA_PROGRESS_MAX = "android.progressMax"

extras key: this is the maximum value supplied to setProgress.

static final String
EXTRA_PROGRESS_POINTS = "android.progressPoints"

extras key: an arraylist of ProgressStyle.Point bundles provided by a android.app.Notification.ProgressStyle notification as supplied to