Most visited

Recently visited

NotificationCompat

public class NotificationCompat
extends Object

java.lang.Object
   ↳ android.support.v4.app.NotificationCompat
Known Direct Subclasses


Helper for accessing features in Notification introduced after API level 4 in a backwards compatible fashion.

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.Builder

Builder class for NotificationCompat objects. 

class NotificationCompat.CarExtender

Helper class to add Android Auto extensions to notifications. 

interface NotificationCompat.Extender

Extender interface for use with 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.Action.Builder object. 

class NotificationCompat.WearableExtender

Helper class to add wearable extensions to notifications. 

Constants

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_MESSAGE

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

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_SYSTEM

Notification category: system or device status update.

String CATEGORY_TRANSPORT

Notification category: media transport control for playback.

int COLOR_DEFAULT

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.

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_BACKGROUND_IMAGE_URI

Notification 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

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

String EXTRA_COMPACT_ACTIONS

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

String EXTRA_CONVERSATION_TITLE

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

String EXTRA_INFO_TEXT

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

String EXTRA_LARGE_ICON

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

String EXTRA_LARGE_ICON_BIG

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

String EXTRA_MEDIA_SESSION

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

String EXTRA_MESSAGES

Notification key: an array of Bundle objects representing NotificationCompat.MessagingStyle.Message objects for a NotificationCompat.MessagingStyle notification.

String EXTRA_PEOPLE

Notification extras key: A String array containing the people that this notification relates to, each of which was supplied to addPerson(String).

String EXTRA_PICTURE

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

String EXTRA_PROGRESS

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

String EXTRA_PROGRESS_INDETERMINATE

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

String EXTRA_PROGRESS_MAX

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

String EXTRA_REMOTE_INPUT_HISTORY

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

String EXTRA_SELF_DISPLAY_NAME

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

String EXTRA_SHOW_CHRONOMETER

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

String EXTRA_SHOW_WHEN

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

String EXTRA_SMALL_ICON

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

String EXTRA_SUB_TEXT

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

String EXTRA_SUMMARY_TEXT

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

String EXTRA_TEMPLATE

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

String EXTRA_TEXT

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

String EXTRA_TEXT_LINES

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

String EXTRA_TITLE

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

String EXTRA_TITLE_BIG

Notification 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_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 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.

int FLAG_ONLY_ALERT_ONCE

Bit set in the Notification flags field if the notification's sound, vibrate and ticker should only be played if the notification is not already showing.

int FLAG_SHOW_LIGHTS

Bit set in the Notification flags field when LEDs should be turned on for this notification.

int PRIORITY_DEFAULT

Default notification priority for setPriority(int).

int PRIORITY_HIGH

Higher notification priority for setPriority(int), for more important notifications or alerts.

int PRIORITY_LOW

Lower notification priority for setPriority(int), for items that are less important.

int PRIORITY_MAX

Highest notification priority for setPriority(int), for your application's most important items that require the user's prompt attention or input.

int PRIORITY_MIN

Lowest notification priority for setPriority(int); these items might not be shown to the user except under special circumstances, such as detailed notification logs.

int STREAM_DEFAULT

Use this constant as the value for audioStreamType to request that the default stream type for notifications be used.

int VISIBILITY_PRIVATE

Notification visibility: Show this notification on all lockscreens, but conceal sensitive or private information on secure lockscreens.

int VISIBILITY_PUBLIC

Notification visibility: Show this notification in its entirety on all lockscreens.

int VISIBILITY_SECRET

Notification visibility: Do not reveal any part of this notification on a secure lockscreen.

Public constructors

NotificationCompat()

Public methods

static NotificationCompat.Action getAction(Notification notif, int actionIndex)

Get an action on this notification in a backwards compatible manner.

static int getActionCount(Notification notif)

Get the number of actions in this notification in a backwards compatible manner.

static String getCategory(Notification notif)

Get the category of this notification in a backwards compatible manner.

static Bundle getExtras(Notification notif)

Gets the extras field from a notification in a backwards compatible manner.

static String getGroup(Notification notif)

Get the key used to group this notification into a cluster or stack with other notifications on devices which support such rendering.

static boolean getLocalOnly(Notification notif)

Get whether or not this notification is only relevant to the current device.

static String getSortKey(Notification notif)

Get a sort key that orders this notification among other notifications from the same package.

static boolean isGroupSummary(Notification notif)

Get whether this notification to be the group summary for a group of notifications.

Inherited methods

From class java.lang.Object

Constants

CATEGORY_ALARM

String CATEGORY_ALARM

Notification category: alarm or timer.

Constant Value: "alarm"

CATEGORY_CALL

String CATEGORY_CALL

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

Constant Value: "call"

CATEGORY_EMAIL

String CATEGORY_EMAIL

Notification category: asynchronous bulk message (email).

Constant Value: "email"

CATEGORY_ERROR

String CATEGORY_ERROR

Notification category: error in background operation or authentication status.

Constant Value: "err"

CATEGORY_EVENT

String CATEGORY_EVENT

Notification category: calendar event.

Constant Value: "event"

CATEGORY_MESSAGE

String CATEGORY_MESSAGE

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

Constant Value: "msg"

CATEGORY_PROGRESS

String CATEGORY_PROGRESS

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

Constant Value: "progress"

CATEGORY_PROMO

String CATEGORY_PROMO

Notification category: promotion or advertisement.

Constant Value: "promo"

CATEGORY_RECOMMENDATION

String CATEGORY_RECOMMENDATION

Notification category: a specific, timely recommendation for a single thing. For example, a news app might want to recommend a news story it believes the user will want to read next.

Constant Value: "recommendation"

CATEGORY_REMINDER

String CATEGORY_REMINDER

Notification category: user-scheduled reminder.

Constant Value: "reminder"

CATEGORY_SERVICE

String CATEGORY_SERVICE

Notification category: indication of running background service.

Constant Value: "service"

CATEGORY_SOCIAL

String CATEGORY_SOCIAL

Notification category: social network or sharing update.

Constant Value: "social"

CATEGORY_STATUS

String CATEGORY_STATUS

Notification category: ongoing information about device or contextual status.

Constant Value: "status"

CATEGORY_SYSTEM

String CATEGORY_SYSTEM

Notification category: system or device status update. Reserved for system use.

Constant Value: "sys"

CATEGORY_TRANSPORT

String CATEGORY_TRANSPORT

Notification category: media transport control for playback.

Constant Value: "transport"

COLOR_DEFAULT

int COLOR_DEFAULT

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.

Constant Value: 0 (0x00000000)

DEFAULT_ALL

int DEFAULT_ALL

Use all default values (where applicable).

Constant Value: -1 (0xffffffff)

DEFAULT_LIGHTS

int DEFAULT_LIGHTS

Use the default notification lights. This will ignore the FLAG_SHOW_LIGHTS bit, and values set with setLights(int, int, int).

See also:

Constant Value: 4 (0x00000004)

DEFAULT_SOUND

int DEFAULT_SOUND

Use the default notification sound. This will ignore any sound set using setSound(Uri)

A notification that is noisy is more likely to be presented as a heads-up notification, on some platforms.

See also:

Constant Value: 1 (0x00000001)

DEFAULT_VIBRATE

int DEFAULT_VIBRATE

Use the default notification vibrate. This will ignore any vibrate set using setVibrate(long[]). Using phone vibration requires the VIBRATE permission.

A notification that vibrates is more likely to be presented as a heads-up notification, on some platforms.

See also:

Constant Value: 2 (0x00000002)

EXTRA_BACKGROUND_IMAGE_URI

String EXTRA_BACKGROUND_IMAGE_URI

Notification extras key: A content URI pointing to an image that can be displayed in the background when the notification is selected. The URI must point to an image stream suitable for passing into BitmapFactory.decodeStream; all other content types will be ignored. The content provider URI used for this purpose must require no permissions to read the image data.

Constant Value: "android.backgroundImageUri"

EXTRA_BIG_TEXT

String EXTRA_BIG_TEXT

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

Constant Value: "android.bigText"

EXTRA_COMPACT_ACTIONS

String EXTRA_COMPACT_ACTIONS

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

Constant Value: "android.compactActions"

EXTRA_CONVERSATION_TITLE

String EXTRA_CONVERSATION_TITLE

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

Constant Value: "android.conversationTitle"

EXTRA_INFO_TEXT

String EXTRA_INFO_TEXT

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

Constant Value: "android.infoText"

EXTRA_LARGE_ICON

String EXTRA_LARGE_ICON

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

Constant Value: "android.largeIcon"

EXTRA_LARGE_ICON_BIG

String EXTRA_LARGE_ICON_BIG

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

Constant Value: "android.largeIcon.big"

EXTRA_MEDIA_SESSION

String EXTRA_MEDIA_SESSION

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

Constant Value: "android.mediaSession"

EXTRA_MESSAGES

String EXTRA_MESSAGES

Notification key: an array of Bundle objects representing NotificationCompat.MessagingStyle.Message objects for a NotificationCompat.MessagingStyle notification.

Constant Value: "android.messages"

EXTRA_PEOPLE

String EXTRA_PEOPLE

Notification extras key: A String array containing the people that this notification relates to, each of which was supplied to addPerson(String).

Constant Value: "android.people"

EXTRA_PICTURE

String EXTRA_PICTURE

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

Constant Value: "android.picture"

EXTRA_PROGRESS

String EXTRA_PROGRESS

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

Constant Value: "android.progress"

EXTRA_PROGRESS_INDETERMINATE

String EXTRA_PROGRESS_INDETERMINATE

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

Constant Value: "android.progressIndeterminate"

EXTRA_PROGRESS_MAX

String EXTRA_PROGRESS_MAX

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

Constant Value: "android.progressMax"

EXTRA_REMOTE_INPUT_HISTORY

String EXTRA_REMOTE_INPUT_HISTORY

Notification extras key: this is the remote input history, as supplied to setRemoteInputHistory(CharSequence[]). Apps can fill this through setRemoteInputHistory(CharSequence[]) with the most recent inputs that have been sent through a RemoteInput of this Notification and are expected to clear it once the it is no longer relevant (e.g. for chat notifications once the other party has responded). The extra with this key is of type CharSequence[] and contains the most recent entry at the 0 index, the second most recent at the 1 index, etc.

See also:

Constant Value: "android.remoteInputHistory"

EXTRA_SELF_DISPLAY_NAME

String EXTRA_SELF_DISPLAY_NAME

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

Constant Value: "android.selfDisplayName"

EXTRA_SHOW_CHRONOMETER

String EXTRA_SHOW_CHRONOMETER

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

Constant Value: "android.showChronometer"

EXTRA_SHOW_WHEN

String EXTRA_SHOW_WHEN

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

Constant Value: "android.showWhen"

EXTRA_SMALL_ICON

String EXTRA_SMALL_ICON

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

Constant Value: "android.icon"

EXTRA_SUB_TEXT

String EXTRA_SUB_TEXT

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

Constant Value: "android.subText"

EXTRA_SUMMARY_TEXT

String EXTRA_SUMMARY_TEXT

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

Constant Value: "android.summaryText"

EXTRA_TEMPLATE

String EXTRA_TEMPLATE

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

Constant Value: "android.template"

EXTRA_TEXT

String EXTRA_TEXT

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

Constant Value: "android.text"

EXTRA_TEXT_LINES

String EXTRA_TEXT_LINES

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

Constant Value: "android.textLines"

EXTRA_TITLE

String EXTRA_TITLE

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

Constant Value: "android.title"

EXTRA_TITLE_BIG

String EXTRA_TITLE_BIG

Notification extras key: this is the title of the notification when shown in expanded form, e.g. as supplied to setBigContentTitle(CharSequence).

Constant Value: "android.title.big"

FLAG_AUTO_CANCEL

int FLAG_AUTO_CANCEL

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

Constant Value: 16 (0x00000010)

FLAG_FOREGROUND_SERVICE

int FLAG_FOREGROUND_SERVICE

Bit set in the Notification flags field if this notification represents a currently running service. This will normally be set for you by startForeground(int, Notification).

Constant Value: 64 (0x00000040)

FLAG_GROUP_SUMMARY

int FLAG_GROUP_SUMMARY

Bit set in the Notification flags field if this notification is the group summary for a group of notifications. Grouped notifications may display in a cluster or stack on devices which support such rendering. Requires a group key also be set using setGroup(String).

Constant Value: 512 (0x00000200)

FLAG_HIGH_PRIORITY

int FLAG_HIGH_PRIORITY

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

Obsolete flag indicating high-priority notifications; use the priority field instead.

Constant Value: 128 (0x00000080)

FLAG_INSISTENT

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.

Constant Value: 4 (0x00000004)

FLAG_LOCAL_ONLY

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.

Constant Value: 256 (0x00000100)

FLAG_NO_CLEAR

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.

Constant Value: 32 (0x00000020)

FLAG_ONGOING_EVENT

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. It should not be set if this notification is in reference to something that happened at a particular point in time, like a missed phone call.

Constant Value: 2 (0x00000002)

FLAG_ONLY_ALERT_ONCE

int FLAG_ONLY_ALERT_ONCE

Bit set in the Notification flags field if the notification's sound, vibrate and ticker should only be played if the notification is not already showing.

Constant Value: 8 (0x00000008)

FLAG_SHOW_LIGHTS

int FLAG_SHOW_LIGHTS

Bit set in the Notification flags field when LEDs should be turned on for this notification.

Constant Value: 1 (0x00000001)

PRIORITY_DEFAULT

int PRIORITY_DEFAULT

Default notification priority for setPriority(int). If your application does not prioritize its own notifications, use this value for all notifications.

Constant Value: 0 (0x00000000)

PRIORITY_HIGH

int PRIORITY_HIGH

Higher notification priority for setPriority(int), for more important notifications or alerts. The UI may choose to show these items larger, or at a different position in notification lists, compared with your app's PRIORITY_DEFAULT items.

Constant Value: 1 (0x00000001)

PRIORITY_LOW

int PRIORITY_LOW

Lower notification priority for setPriority(int), for items that are less important. The UI may choose to show these items smaller, or at a different position in the list, compared with your app's PRIORITY_DEFAULT items.

Constant Value: -1 (0xffffffff)

PRIORITY_MAX

int PRIORITY_MAX

Highest notification priority for setPriority(int), for your application's most important items that require the user's prompt attention or input.

Constant Value: 2 (0x00000002)

PRIORITY_MIN

int PRIORITY_MIN

Lowest notification priority for setPriority(int); these items might not be shown to the user except under special circumstances, such as detailed notification logs.

Constant Value: -2 (0xfffffffe)

STREAM_DEFAULT

int STREAM_DEFAULT

Use this constant as the value for audioStreamType to request that the default stream type for notifications be used. Currently the default stream type is STREAM_NOTIFICATION.

Constant Value: -1 (0xffffffff)

VISIBILITY_PRIVATE

int VISIBILITY_PRIVATE

Notification visibility: Show this notification on all lockscreens, but conceal sensitive or private information on secure lockscreens.

See also:

Constant Value: 0 (0x00000000)

VISIBILITY_PUBLIC

int VISIBILITY_PUBLIC

Notification visibility: Show this notification in its entirety on all lockscreens.

See also:

Constant Value: 1 (0x00000001)

VISIBILITY_SECRET

int VISIBILITY_SECRET

Notification visibility: Do not reveal any part of this notification on a secure lockscreen.

See also:

Constant Value: -1 (0xffffffff)

Public constructors

NotificationCompat

NotificationCompat ()

Public methods

getAction

NotificationCompat.Action getAction (Notification notif, 
                int actionIndex)

Get an action on this notification in a backwards compatible manner. Actions were supported from JellyBean (Api level 16) forwards.

Parameters
notif Notification: The notification to inspect.
actionIndex int: The index of the action to retrieve.
Returns
NotificationCompat.Action

getActionCount

int getActionCount (Notification notif)

Get the number of actions in this notification in a backwards compatible manner. Actions were supported from JellyBean (Api level 16) forwards.

Parameters
notif Notification
Returns
int

getCategory

String getCategory (Notification notif)

Get the category of this notification in a backwards compatible manner.

Parameters
notif Notification: The notification to inspect.
Returns
String

getExtras

Bundle getExtras (Notification notif)

Gets the extras field from a notification in a backwards compatible manner. Extras field was supported from JellyBean (Api level 16) forwards. This function will return null on older api levels.

Parameters
notif Notification
Returns
Bundle

getGroup

String getGroup (Notification notif)

Get the key used to group this notification into a cluster or stack with other notifications on devices which support such rendering.

Parameters
notif Notification
Returns
String

getLocalOnly

boolean getLocalOnly (Notification notif)

Get whether or not this notification is only relevant to the current device.

Some notifications can be bridged to other devices for remote display. If this hint is set, it is recommend that this notification not be bridged.

Parameters
notif Notification
Returns
boolean

getSortKey

String getSortKey (Notification notif)

Get a sort key that orders this notification among other notifications from the same package. This can be useful if an external sort was already applied and an app would like to preserve this. Notifications will be sorted lexicographically using this value, although providing different priorities in addition to providing sort key may cause this value to be ignored.

This sort key can also be used to order members of a notification group. See setGroup(String).

Parameters
notif Notification
Returns
String

See also:

isGroupSummary

boolean isGroupSummary (Notification notif)

Get whether this notification to be the group summary for a group of notifications. Grouped notifications may display in a cluster or stack on devices which support such rendering. Requires a group key also be set using setGroup(String).

Parameters
notif Notification
Returns
boolean Whether this notification is a group summary.

Hooray!