This method was deprecated
in API level 24.
use setSubText(CharSequence) instead to set a text in the header.
For legacy apps targeting a version below N this
field will still show up, but the subtext will take precedence.

Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.

A notification in its expanded form can display up to 3 actions, from left to right in
the order they were added. Actions will not be displayed when the notification is
collapsed, however, so be sure that any essential functions may be accessed by the user
in some other way (for example, in the Activity pointed to by contentIntent).

A notification in its expanded form can display up to 3 actions, from left to right in
the order they were added. Actions will not be displayed when the notification is
collapsed, however, so be sure that any essential functions may be accessed by the user
in some other way (for example, in the Activity pointed to by contentIntent).

addPerson

Depending on user preferences, this annotation may allow the notification to pass
through interruption filters, if this notification is of category CATEGORY_CALL
or CATEGORY_MESSAGE. The addition of people may also cause this notification to
appear more prominently in the user interface.

The system will also attempt to resolve mailto: and tel: schema
URIs. The path part of these URIs must exist in the contacts database, in the
appropriate column, or the reference will be discarded as invalid. Telephone schema
URIs will be resolved by ContactsContract.PhoneLookup.

setContentInfo

This method was deprecated
in API level 24.
use setSubText(CharSequence) instead to set a text in the header.
For legacy apps targeting a version below N this
field will still show up, but the subtext will take precedence.

A small piece of additional information pertaining to this notification.
The platform template will draw this on the last line of the notification, at the far
right (to the right of a smallIcon if it has been placed there).

setFullScreenIntent

An intent to launch instead of posting the notification to the status bar.
Only for use with extremely high-priority notifications demanding the user's
immediate attention, such as an incoming phone call or
alarm clock that the user has explicitly set to a particular time.
If this facility is used for something else, please give the user an option
to turn it off and use a normal notification, as this can be extremely
disruptive.

The system UI may choose to display a heads-up notification, instead of
launching this intent, while the user is using the device.

Parameters

intent

PendingIntent: The pending intent to launch.

highPriority

boolean: Passing true will cause this notification to be sent
even if other notifications are suppressed.

setGroupAlertBehavior

Sets the group alert behavior for this notification. Use this method to mute this
notification if alerts for this notification's group should be handled by a different
notification. This is only applicable for notifications that belong to a
group. This must be called on all notifications you want to
mute. For example, if you want only the summary of your group to make noise, all
children in the group should have the group alert behavior GROUP_ALERT_SUMMARY.

setGroupSummary

Set 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. If thereRequires a group key also be set using setGroup(String).
The group summary may be suppressed if too few notifications are included in the group.

setLargeIcon

Add a large icon to the notification content view.
In the platform template, this image will be shown on the left of the notification view
in place of the small icon (which will be placed in a small
badge atop the large icon).

setLargeIcon

Add a large icon to the notification content view.
In the platform template, this image will be shown on the left of the notification view
in place of the small icon (which will be placed in a small
badge atop the large icon).

setOngoing

Set whether this is an "ongoing" notification.
Ongoing notifications cannot be dismissed by the user, so your application or service
must take care of canceling them.
They are typically used to indicate a background task that the user is actively engaged
with (e.g., playing music) or is pending in some way and therefore occupying the device
(e.g., a file download, sync operation, active network connection).

setRemoteInputHistory

Set the remote input history.
This should be set to the most recent inputs that have been sent
through a RemoteInput of this Notification and cleared once the it is no
longer relevant (e.g. for chat notifications once the other party has responded).
The most recent input must be stored at the 0 index, the second most recent at the
1 index, etc. Note that the system will limit both how far back the inputs will be shown
and how much of each individual input is shown.

Note: The reply text will only be shown on notifications that have least one action
with a RemoteInput.

setSettingsText

Provides text that will appear as a link to your application's settings.

This text does not appear within notification templates but may
appear when the user uses an affordance to learn more about the notification.
Additionally, this text will not appear unless you provide a valid link target by
handling INTENT_CATEGORY_NOTIFICATION_PREFERENCES.

This text is meant to be concise description about what the user can customize
when they click on this link. The recommended maximum length is 40 characters.

setShortcutId

If this notification is duplicative of a Launcher shortcut, sets the
id of the shortcut, in case the Launcher wants to hide
the shortcut.
This field will be ignored by Launchers that don't support badging, don't show
notification content, or don't show shortcuts.

setSmallIcon

Set the small icon resource, which will be used to represent the notification in the
status bar.
The platform template for the expanded view will draw this icon in the left, unless a
large icon has also been specified, in which case the small
icon will be moved to the right-hand side.

Parameters

icon

int: A resource ID in the application's package of the drawable to use.

setSortKey

Set 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).

setSubText

This provides some additional information that is displayed in the notification. No
guarantees are given where exactly it is displayed.

This information should only be provided if it provides an essential
benefit to the understanding of the notification. The more text you provide the
less readable it becomes. For example, an email client should only provide the account
name here if more than one email account has been added.

As of N this information is displayed in the
notification header area.
On Android versions before N
this will be shown in the third line of text in the platform notification template.
You should not be using setProgress(int, int, boolean) at the
same time on those versions; they occupy the same place.

setUsesChronometer

Show the when field as a stopwatch.
Instead of presenting when as a timestamp, the notification will show an
automatically updating display of the minutes and seconds since when.
Useful when showing an elapsed time (like an ongoing phone call).
The counter can also be set to count down to when when using
setChronometerCountDown(boolean).

setWhen

Add a timestamp pertaining to the notification (usually the time the event occurred).
For apps targeting N and above, this time is not
shown anymore by default and must be opted into by using
setShowWhen(boolean)