Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/app/Notification.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/app/Notification.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/Notification.Builder#inhmethods)

# Notification.Builder

*** ** * ** ***


`
public
static


class
Notification.Builder
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.Notification.Builder |

<br />

*** ** * ** ***

Builder class for `https://developer.android.com/reference/android/app/Notification` objects.

Provides a convenient way to set the various fields of a `https://developer.android.com/reference/android/app/Notification` and generate
content views using the platform's notification layout template. If your app supports
versions of Android as old as API level 4, you can instead use
`https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder.html`,
available in the [Android Support
library](https://developer.android.com/tools/extras/support-library).

Example:

```
Notification noti = new Notification.Builder(mContext)
        .setContentTitle("New mail from " + sender.toString())
        .setContentText(subject)
        .setSmallIcon(R.drawable.new_mail)
        .setLargeIcon(aBitmap)
        .build();
```

<br />

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/app/Notification.Builder#Builder(android.content.Context)(https://developer.android.com/reference/android/content/Context context) ` *This constructor is deprecated. use `https://developer.android.com/reference/android/app/Notification.Builder#Builder(android.content.Context,%20java.lang.String)` instead. All posted Notifications must specify a NotificationChannel Id.* |
| ` https://developer.android.com/reference/android/app/Notification.Builder#Builder(android.content.Context,%20java.lang.String)(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/java/lang/String channelId) ` Constructs a new Builder with the defaults: |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#addAction(int,%20java.lang.CharSequence,%20android.app.PendingIntent)(int icon, https://developer.android.com/reference/java/lang/CharSequence title, https://developer.android.com/reference/android/app/PendingIntent intent) ` *This method was deprecated in API level 23. Use `https://developer.android.com/reference/android/app/Notification.Builder#addAction(android.app.Notification.Action)` instead.* |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#addAction(android.app.Notification.Action)(https://developer.android.com/reference/android/app/Notification.Action action) ` Add an action to this notification. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#addExtras(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle extras) ` Merge additional metadata into this notification. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#addPerson(java.lang.String)(https://developer.android.com/reference/java/lang/String uri) ` *This method was deprecated in API level 28. use `https://developer.android.com/reference/android/app/Notification.Builder#addPerson(android.app.Person)`* |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#addPerson(android.app.Person)(https://developer.android.com/reference/android/app/Person person) ` Add a person that is relevant to this notification. |
| ` https://developer.android.com/reference/android/app/Notification` | ` https://developer.android.com/reference/android/app/Notification.Builder#build()() ` Combine all of the options that have been set and return a new `https://developer.android.com/reference/android/app/Notification` object. |
| ` https://developer.android.com/reference/android/widget/RemoteViews` | ` https://developer.android.com/reference/android/app/Notification.Builder#createBigContentView()() ` *This method was deprecated in API level 35. For performance and system health reasons, this API is no longer required to be used directly by the System UI when rendering Notifications to the user. While the UI returned by this method will still represent the content of the Notification being built, it may differ from the visual style of the system. NOTE: this API has always had severe limitations; for example it does not support any interactivity, it ignores the app theme, it hard-codes the colors from the system theme at the time it is called, and it does Bitmap decoding on the main thread which can cause UI jank.* |
| ` https://developer.android.com/reference/android/widget/RemoteViews` | ` https://developer.android.com/reference/android/app/Notification.Builder#createContentView()() ` *This method was deprecated in API level 35. For performance and system health reasons, this API is no longer required to be used directly by the System UI when rendering Notifications to the user. While the UI returned by this method will still represent the content of the Notification being built, it may differ from the visual style of the system. NOTE: this API has always had severe limitations; for example it does not support any interactivity, it ignores the app theme, it hard-codes the colors from the system theme at the time it is called, and it does Bitmap decoding on the main thread which can cause UI jank.* |
| ` https://developer.android.com/reference/android/widget/RemoteViews` | ` https://developer.android.com/reference/android/app/Notification.Builder#createHeadsUpContentView()() ` *This method was deprecated in API level 35. For performance and system health reasons, this API is no longer required to be used directly by the System UI when rendering Notifications to the user. While the UI returned by this method will still represent the content of the Notification being built, it may differ from the visual style of the system. NOTE: this API has always had severe limitations; for example it does not support any interactivity, it ignores the app theme, it hard-codes the colors from the system theme at the time it is called, and it does Bitmap decoding on the main thread which can cause UI jank.* |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#extend(android.app.Notification.Extender)(https://developer.android.com/reference/android/app/Notification.Extender extender) ` Apply an extender to this notification builder. |
| ` https://developer.android.com/reference/android/os/Bundle` | ` https://developer.android.com/reference/android/app/Notification.Builder#getExtras()() ` Get the current metadata Bundle used by this notification Builder. |
| ` https://developer.android.com/reference/android/app/Notification` | ` https://developer.android.com/reference/android/app/Notification.Builder#getNotification()() ` *This method was deprecated in API level 16. Use `https://developer.android.com/reference/android/app/Notification.Builder#build()` instead.* |
| ` https://developer.android.com/reference/android/app/Notification.Style` | ` https://developer.android.com/reference/android/app/Notification.Builder#getStyle()() ` Returns the style set by `https://developer.android.com/reference/android/app/Notification.Builder#setStyle(android.app.Notification.Style)`. |
| ` static https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#recoverBuilder(android.content.Context,%20android.app.Notification)(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/app/Notification n) ` Creates a Builder from an existing notification so further changes can be made. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setActions(android.app.Notification.Action[])(https://developer.android.com/reference/android/app/Notification.Action actions) ` Alter the complete list of actions attached to this notification. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setAllowSystemGeneratedContextualActions(boolean)(boolean allowed) ` Determines whether the platform can generate contextual actions for a notification. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setAutoCancel(boolean)(boolean autoCancel) ` Make this notification automatically dismissed when the user touches it. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setBadgeIconType(int)(int icon) ` Sets which icon to display as a badge for this notification. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setBubbleMetadata(android.app.Notification.BubbleMetadata)(https://developer.android.com/reference/android/app/Notification.BubbleMetadata data) ` Sets the `https://developer.android.com/reference/android/app/Notification.BubbleMetadata` that will be used to display app content in a floating window over the existing foreground activity. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setCategory(java.lang.String)(https://developer.android.com/reference/java/lang/String category) ` Set the notification category. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setChannelId(java.lang.String)(https://developer.android.com/reference/java/lang/String channelId) ` Specifies the channel the notification should be delivered on. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setChronometerCountDown(boolean)(boolean countDown) ` Sets the Chronometer to count down instead of counting up. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setColor(int)(int argb) ` Sets `https://developer.android.com/reference/android/app/Notification#color`. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setColorized(boolean)(boolean colorize) ` Set whether this notification should be colorized. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setContent(android.widget.RemoteViews)(https://developer.android.com/reference/android/widget/RemoteViews views) ` Supply a custom RemoteViews to use instead of the platform template. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setContentInfo(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence info) ` *This method was deprecated in API level 24. use `https://developer.android.com/reference/android/app/Notification.Builder#setSubText(java.lang.CharSequence)` instead to set a text in the header. For legacy apps targeting a version below `https://developer.android.com/reference/android/os/Build.VERSION_CODES#N` this field will still show up, but the subtext will take precedence.* |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setContentIntent(android.app.PendingIntent)(https://developer.android.com/reference/android/app/PendingIntent intent) ` Supply a `https://developer.android.com/reference/android/app/PendingIntent` to be sent when the notification is clicked. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setContentText(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence text) ` Set the second line of text in the platform notification template. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setContentTitle(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence title) ` Set the first line of text in the platform notification template. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setCustomBigContentView(android.widget.RemoteViews)(https://developer.android.com/reference/android/widget/RemoteViews contentView) ` Supply custom RemoteViews to use instead of the platform template in the expanded form. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setCustomContentView(android.widget.RemoteViews)(https://developer.android.com/reference/android/widget/RemoteViews contentView) ` Supply custom RemoteViews to use instead of the platform template. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setCustomHeadsUpContentView(android.widget.RemoteViews)(https://developer.android.com/reference/android/widget/RemoteViews contentView) ` Supply custom RemoteViews to use instead of the platform template in the heads up dialog. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setDefaults(int)(int defaults) ` *This method was deprecated in API level 26. use `https://developer.android.com/reference/android/app/NotificationChannel#enableVibration(boolean)` and `https://developer.android.com/reference/android/app/NotificationChannel#enableLights(boolean)` and `https://developer.android.com/reference/android/app/NotificationChannel#setSound(android.net.Uri,%20android.media.AudioAttributes)` instead.* |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setDeleteIntent(android.app.PendingIntent)(https://developer.android.com/reference/android/app/PendingIntent intent) ` Supply a `https://developer.android.com/reference/android/app/PendingIntent` to send when the notification is cleared explicitly by the user. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setExtras(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle extras) ` Set metadata for this notification. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setFlag(int,%20boolean)(int mask, boolean value) ` Set the value for a notification flag |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setForegroundServiceBehavior(int)(int behavior) ` Specify a desired visibility policy for a Notification associated with a foreground service. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setFullScreenIntent(android.app.PendingIntent,%20boolean)(https://developer.android.com/reference/android/app/PendingIntent intent, boolean highPriority) ` An intent to launch instead of posting the notification to the status bar. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setGroup(java.lang.String)(https://developer.android.com/reference/java/lang/String groupKey) ` Set this notification to be part of a group of notifications sharing the same key. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setGroupAlertBehavior(int)(int groupAlertBehavior) ` Sets the group alert behavior for this notification. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setGroupSummary(boolean)(boolean isGroupSummary) ` Set this notification to be the group summary for a group of notifications. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setHasSummarizedContent(boolean)(boolean hasSummarizedContent) ` Sets whether this notification contains text that was computationally summarized from other sources. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setLargeIcon(android.graphics.Bitmap)(https://developer.android.com/reference/android/graphics/Bitmap b) ` Add a large icon to the notification content view. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setLargeIcon(android.graphics.drawable.Icon)(https://developer.android.com/reference/android/graphics/drawable/Icon icon) ` Add a large icon to the notification content view. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setLights(int,%20int,%20int)(int argb, int onMs, int offMs) ` *This method was deprecated in API level 26. use `https://developer.android.com/reference/android/app/NotificationChannel#enableLights(boolean)` instead.* |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setLocalOnly(boolean)(boolean localOnly) ` Set whether or not this notification should not bridge to other devices. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setLocusId(android.content.LocusId)(https://developer.android.com/reference/android/content/LocusId locusId) ` Sets the `https://developer.android.com/reference/android/content/LocusId` associated with this notification. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setNumber(int)(int number) ` Sets the number of items this notification represents. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setOngoing(boolean)(boolean ongoing) ` Set whether this is an "ongoing" notification. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setOnlyAlertOnce(boolean)(boolean onlyAlertOnce) ` Set this flag if you would only like the sound, vibrate and ticker to be played if the notification is not already showing. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setPriority(int)(int pri) ` *This method was deprecated in API level 26. use `https://developer.android.com/reference/android/app/NotificationChannel#setImportance(int)` instead.* |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setProgress(int,%20int,%20boolean)(int max, int progress, boolean indeterminate) ` Set the progress this notification represents. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setPublicVersion(android.app.Notification)(https://developer.android.com/reference/android/app/Notification n) ` Supply a replacement Notification whose contents should be shown in insecure contexts (i.e. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setRemoteInputHistory(java.lang.CharSequence[])(https://developer.android.com/reference/java/lang/CharSequence text) ` Set the remote input history. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setRequestPromotedOngoing(boolean)(boolean requestPromotedOngoing) ` Set whether this notification is requesting to be a promoted ongoing notification. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setSettingsText(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence text) ` Provides text that will appear as a link to your application's settings. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setShortCriticalText(java.lang.String)(https://developer.android.com/reference/java/lang/String shortCriticalText) ` Sets a very short string summarizing the most critical information contained in the notification. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setShortcutId(java.lang.String)(https://developer.android.com/reference/java/lang/String shortcutId) ` From Android 11, messaging notifications (those that use `https://developer.android.com/reference/android/app/Notification.MessagingStyle`) that use this method to link to a published long-lived sharing shortcut may appear in a dedicated Conversation section of the shade and may show configuration options that are unique to conversations. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setShowWhen(boolean)(boolean show) ` Control whether the timestamp set with `https://developer.android.com/reference/android/app/Notification.Builder#setWhen(long)` is shown in the content view. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setSmallIcon(int,%20int)(int icon, int level) ` A variant of `https://developer.android.com/reference/android/app/Notification.Builder#setSmallIcon(int)` that takes an additional level parameter for when the icon is a `https://developer.android.com/reference/android/graphics/drawable/LevelListDrawable`. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setSmallIcon(int)(int icon) ` Set the small icon resource, which will be used to represent the notification in the status bar. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setSmallIcon(android.graphics.drawable.Icon)(https://developer.android.com/reference/android/graphics/drawable/Icon icon) ` Set the small icon, which will be used to represent the notification in the status bar. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setSortKey(java.lang.String)(https://developer.android.com/reference/java/lang/String sortKey) ` Set a sort key that orders this notification among other notifications from the same package. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setSound(android.net.Uri,%20android.media.AudioAttributes)(https://developer.android.com/reference/android/net/Uri sound, https://developer.android.com/reference/android/media/AudioAttributes audioAttributes) ` *This method was deprecated in API level 26. use `https://developer.android.com/reference/android/app/NotificationChannel#setSound(android.net.Uri,%20android.media.AudioAttributes)` instead.* |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setSound(android.net.Uri)(https://developer.android.com/reference/android/net/Uri sound) ` *This method was deprecated in API level 26. use `https://developer.android.com/reference/android/app/NotificationChannel#setSound(android.net.Uri,%20android.media.AudioAttributes)` instead.* |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setSound(android.net.Uri,%20int)(https://developer.android.com/reference/android/net/Uri sound, int streamType) ` *This method was deprecated in API level 21. use `https://developer.android.com/reference/android/app/NotificationChannel#setSound(android.net.Uri,%20android.media.AudioAttributes)`.* |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setStyle(android.app.Notification.Style)(https://developer.android.com/reference/android/app/Notification.Style style) ` Add a rich notification style to be applied at build time. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setSubText(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence text) ` This provides some additional information that is displayed in the notification. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setTicker(java.lang.CharSequence,%20android.widget.RemoteViews)(https://developer.android.com/reference/java/lang/CharSequence tickerText, https://developer.android.com/reference/android/widget/RemoteViews views) ` Obsolete version of `https://developer.android.com/reference/android/app/Notification.Builder#setTicker(java.lang.CharSequence)`. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setTicker(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence tickerText) ` Set the "ticker" text which is sent to accessibility services. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setTimeoutAfter(long)(long durationMs) ` Specifies a duration in milliseconds after which this notification should be canceled, if it is not already canceled. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setUsesChronometer(boolean)(boolean b) ` Show the `https://developer.android.com/reference/android/app/Notification#when` field as a stopwatch. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setVibrate(long[])(long[] pattern) ` *This method was deprecated in API level 26. use `https://developer.android.com/reference/android/app/NotificationChannel#setVibrationPattern(long[])` instead.* |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setVisibility(int)(int visibility) ` Specify the value of `https://developer.android.com/reference/android/app/Notification#visibility`. |
| ` https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Builder#setWhen(long)(long when) ` Add a timestamp pertaining to the notification (usually the time the event occurred). |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Public constructors

### Builder

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder (Context context)
```


**This constructor is deprecated.**   

use `https://developer.android.com/reference/android/app/Notification.Builder#Builder(android.content.Context,%20java.lang.String)`
instead. All posted Notifications must specify a NotificationChannel Id.

<br />

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |

### Builder

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder (Context context, 
                String channelId)
```

Constructs a new Builder with the defaults:

<br />

| Parameters ||
|---|---|
| `context` | `Context`: A `https://developer.android.com/reference/android/content/Context` that will be used by the Builder to construct the RemoteViews. The Context will not be held past the lifetime of this Builder object. <br /> |
| `channelId` | `String`: The constructed Notification will be posted on this `https://developer.android.com/reference/android/app/NotificationChannel`. To use a NotificationChannel, it must first be created using `https://developer.android.com/reference/android/app/NotificationManager#createNotificationChannel(android.app.NotificationChannel)`. <br /> |

## Public methods

### addAction

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder addAction (int icon, 
                CharSequence title, 
                PendingIntent intent)
```


**This method was deprecated
in API level 23.**   

Use `https://developer.android.com/reference/android/app/Notification.Builder#addAction(android.app.Notification.Action)` instead.

Add an action to this notification. Actions are typically displayed by
the system as a button adjacent to the notification content.


Every action must have an icon (32dp square and matching the
[Holo
Dark action bar](https://developer.android.com/design/style/iconography#action-bar) visual style), a textual label, and a `https://developer.android.com/reference/android/app/PendingIntent`.


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 `https://developer.android.com/reference/android/app/Notification#contentIntent`).


As of Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S`, apps targeting API level
`https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or higher won't be able to start activities
while processing broadcast receivers or services in response to notification action
clicks. To launch an activity in those cases, provide a `https://developer.android.com/reference/android/app/PendingIntent` to the
activity itself.


As of Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#N`,
action button icons will not be displayed on action buttons, but are still required
and are available to
`https://developer.android.com/reference/android/service/notification/NotificationListenerService`,
which may display them in other contexts, for example on a wearable device.

<br />

| Parameters ||
|---|---|
| `icon` | `int`: resource ID of a drawable that represents the action <br /> |
| `title` | `CharSequence`: text describing the action <br /> |
| `intent` | `PendingIntent`: PendingIntent to be fired when the action is invoked <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | <br /> |

### addAction

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder addAction (Notification.Action action)
```

Add an action to this notification. Actions are typically displayed by
the system as a button adjacent to the notification content.


Every action must have an icon (32dp square and matching the
[Holo
Dark action bar](https://developer.android.com/design/style/iconography#action-bar) visual style), a textual label, and a `https://developer.android.com/reference/android/app/PendingIntent`.


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 `https://developer.android.com/reference/android/app/Notification#contentIntent`).

<br />

| Parameters ||
|---|---|
| `action` | `Notification.Action`: the action to add <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### addExtras

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder addExtras (Bundle extras)
```

Merge additional metadata into this notification.

Values within the Bundle will replace existing extras values in this Builder.

<br />

| Parameters ||
|---|---|
| `extras` | `Bundle` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#extras`

### addPerson

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder addPerson (String uri)
```


**This method was deprecated
in API level 28.**   

use `https://developer.android.com/reference/android/app/Notification.Builder#addPerson(android.app.Person)`

Add a person that is relevant to this notification.


Depending on user preferences, this annotation may allow the notification to pass
through interruption filters, if this notification is of category `https://developer.android.com/reference/android/app/Notification#CATEGORY_CALL`
or `https://developer.android.com/reference/android/app/Notification#CATEGORY_MESSAGE`. The addition of people may also cause this notification to
appear more prominently in the user interface.


The person should be specified by the `String` representation of a
`https://developer.android.com/reference/android/provider/ContactsContract.Contacts#CONTENT_LOOKUP_URI`.

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 `https://developer.android.com/reference/android/provider/ContactsContract.PhoneLookup`.
It is also possible to provide a URI with the schema `name:` in order to uniquely
identify a person without an entry in the contacts database.

<br />

<br />

| Parameters ||
|---|---|
| `uri` | `String`: a URI for the person <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#EXTRA_PEOPLE`

### addPerson

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder addPerson (Person person)
```

Add a person that is relevant to this notification.


Depending on user preferences, this annotation may allow the notification to pass
through interruption filters, if this notification is of category `https://developer.android.com/reference/android/app/Notification#CATEGORY_CALL`
or `https://developer.android.com/reference/android/app/Notification#CATEGORY_MESSAGE`. The addition of people may also cause this notification to
appear more prominently in the user interface.


A person should usually contain a uri in order to benefit from the ranking boost.
However, even if no uri is provided, it's beneficial to provide other people in the
notification, such that listeners and voice only devices can announce and handle them
properly.

<br />

<br />

| Parameters ||
|---|---|
| `person` | `Person`: the person to add <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#EXTRA_PEOPLE_LIST`

### build

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification build ()
```

Combine all of the options that have been set and return a new `https://developer.android.com/reference/android/app/Notification`
object.

If this notification has `https://developer.android.com/reference/android/app/Notification.BubbleMetadata` attached that was created with
a shortcutId a check will be performed to ensure the shortcutId supplied to bubble
metadata matches the shortcutId set on the notification builder, if one was set.
If the shortcutId's were specified but do not match, an exception is thrown here.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.BubbleMetadata.Builder#Builder(java.lang.String)`
- `https://developer.android.com/reference/android/app/Notification.Builder#setShortcutId(java.lang.String)`

### createBigContentView

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public RemoteViews createBigContentView ()
```


**This method was deprecated
in API level 35.**   

For performance and system health reasons, this API is no longer required to
be used directly by the System UI when rendering Notifications to the user. While the UI
returned by this method will still represent the content of the Notification being
built, it may differ from the visual style of the system.

NOTE: this API has always had severe limitations; for example it does not support any
interactivity, it ignores the app theme, it hard-codes the colors from the system theme
at the time it is called, and it does Bitmap decoding on the main thread which can cause
UI jank.

Construct a RemoteViews representing the expanded notification layout.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/widget/RemoteViews` | <br /> |

### createContentView

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public RemoteViews createContentView ()
```


**This method was deprecated
in API level 35.**   

For performance and system health reasons, this API is no longer required to
be used directly by the System UI when rendering Notifications to the user. While the UI
returned by this method will still represent the content of the Notification being
built, it may differ from the visual style of the system.

NOTE: this API has always had severe limitations; for example it does not support any
interactivity, it ignores the app theme, it hard-codes the colors from the system theme
at the time it is called, and it does Bitmap decoding on the main thread which can cause
UI jank.

Construct a RemoteViews representing the standard notification layout.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/widget/RemoteViews` | <br /> |

### createHeadsUpContentView

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public RemoteViews createHeadsUpContentView ()
```


**This method was deprecated
in API level 35.**   

For performance and system health reasons, this API is no longer required to
be used directly by the System UI when rendering Notifications to the user. While the UI
returned by this method will still represent the content of the Notification being
built, it may differ from the visual style of the system.

NOTE: this API has always had severe limitations; for example it does not support any
interactivity, it ignores the app theme, it hard-codes the colors from the system theme
at the time it is called, and it does Bitmap decoding on the main thread which can cause
UI jank.

Construct a RemoteViews representing the heads up notification layout.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/widget/RemoteViews` | <br /> |

### extend

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder extend (Notification.Extender extender)
```

Apply an extender to this notification builder. Extenders may be used to add
metadata or change options on this builder.

<br />

| Parameters ||
|---|---|
| `extender` | `Notification.Extender` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### getExtras

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Bundle getExtras ()
```

Get the current metadata Bundle used by this notification Builder.

The returned Bundle is shared with this Builder.

The current contents of this Bundle are copied into the Notification each time
`https://developer.android.com/reference/android/app/Notification.Builder#build()` is called.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Bundle` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#extras`

### getNotification

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification getNotification ()
```


**This method was deprecated
in API level 16.**   

Use `https://developer.android.com/reference/android/app/Notification.Builder#build()` instead.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification` | <br /> |

### getStyle

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Style getStyle ()
```

Returns the style set by `https://developer.android.com/reference/android/app/Notification.Builder#setStyle(android.app.Notification.Style)`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Style` | <br /> |

### recoverBuilder

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Notification.Builder recoverBuilder (Context context, 
                Notification n)
```

Creates a Builder from an existing notification so further changes can be made.

<br />

| Parameters ||
|---|---|
| `context` | `Context`: the context for your application / activity <br /> |
| `n` | `Notification`: the notification to create a Builder from <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setActions

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setActions (Action... actions)
```

Alter the complete list of actions attached to this notification.

<br />

| Parameters ||
|---|---|
| `actions` | `Action` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.Builder#addAction(android.app.Notification.Action)`

### setAllowSystemGeneratedContextualActions

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setAllowSystemGeneratedContextualActions (boolean allowed)
```

Determines whether the platform can generate contextual actions for a notification.
By default this is `true`.

<br />

| Parameters ||
|---|---|
| `allowed` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setAutoCancel

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setAutoCancel (boolean autoCancel)
```

Make this notification automatically dismissed when the user touches it.

<br />

| Parameters ||
|---|---|
| `autoCancel` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#FLAG_AUTO_CANCEL`

### setBadgeIconType

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setBadgeIconType (int icon)
```

Sets which icon to display as a badge for this notification.

Must be one of `https://developer.android.com/reference/android/app/Notification#BADGE_ICON_NONE`, `https://developer.android.com/reference/android/app/Notification#BADGE_ICON_SMALL`,
`https://developer.android.com/reference/android/app/Notification#BADGE_ICON_LARGE`.

Note: This value might be ignored, for launchers that don't support badge icons.

<br />

| Parameters ||
|---|---|
| `icon` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setBubbleMetadata

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setBubbleMetadata (Notification.BubbleMetadata data)
```

Sets the `https://developer.android.com/reference/android/app/Notification.BubbleMetadata` that will be used to display app content in a floating
window over the existing foreground activity.

This data will be ignored unless the notification is posted to a channel that
allows `https://developer.android.com/reference/android/app/NotificationChannel#canBubble()`.

Notifications allowed to bubble that have valid bubble metadata will display in
collapsed state outside of the notification shade on unlocked devices. When a user
interacts with the collapsed state, the bubble intent will be invoked and displayed.

<br />

<br />

| Parameters ||
|---|---|
| `data` | `Notification.BubbleMetadata`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setCategory

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setCategory (String category)
```

Set the notification category.

<br />

| Parameters ||
|---|---|
| `category` | `String` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#category`

### setChannelId

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setChannelId (String channelId)
```

Specifies the channel the notification should be delivered on.

<br />

| Parameters ||
|---|---|
| `channelId` | `String` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setChronometerCountDown

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setChronometerCountDown (boolean countDown)
```

Sets the Chronometer to count down instead of counting up.

This is only relevant if `https://developer.android.com/reference/android/app/Notification.Builder#setUsesChronometer(boolean)` has been set to
`true`. If it isn't set the chronometer will count up.

<br />

| Parameters ||
|---|---|
| `countDown` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.Builder#setUsesChronometer(boolean)`

### setColor

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setColor (int argb)
```

Sets `https://developer.android.com/reference/android/app/Notification#color`.

<br />

| Parameters ||
|---|---|
| `argb` | `int`: The accent color to use <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | the same Builder. This value cannot be `null`. <br /> |

### setColorized

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setColorized (boolean colorize)
```

Set whether this notification should be colorized. When set, the color set with
`https://developer.android.com/reference/android/app/Notification.Builder#setColor(int)` will be used as the background color of this notification.


This should only be used for high priority ongoing tasks like navigation, an ongoing
call, or other similarly high-priority events for the user.


For most styles, the coloring will only be applied if the notification is for a
foreground service notification.
However, for `https://developer.android.com/reference/android/app/Notification.MediaStyle` and `https://developer.android.com/reference/android/app/Notification.DecoratedMediaCustomViewStyle` notifications
that have a media session attached there is no such requirement.

<br />

| Parameters ||
|---|---|
| `colorize` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.Builder#setColor(int)`
- `https://developer.android.com/reference/android/app/Notification.MediaStyle#setMediaSession(android.media.session.MediaSession.Token)`

### setContent

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setContent (RemoteViews views)
```

Supply a custom RemoteViews to use instead of the platform template.

Use `https://developer.android.com/reference/android/app/Notification.Builder#setCustomContentView(android.widget.RemoteViews)` instead.

<br />

| Parameters ||
|---|---|
| `views` | `RemoteViews` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | <br /> |

### setContentInfo

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setContentInfo (CharSequence info)
```


**This method was deprecated
in API level 24.**   

use `https://developer.android.com/reference/android/app/Notification.Builder#setSubText(java.lang.CharSequence)` instead to set a text in the header.
For legacy apps targeting a version below `https://developer.android.com/reference/android/os/Build.VERSION_CODES#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).

<br />

| Parameters ||
|---|---|
| `info` | `CharSequence` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | <br /> |

### setContentIntent

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setContentIntent (PendingIntent intent)
```

Supply a `https://developer.android.com/reference/android/app/PendingIntent` to be sent when the notification is clicked.

As of Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S`, apps targeting API level
`https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or higher won't be able to start activities
while processing broadcast receivers or services in response to notification clicks. To
launch an activity in those cases, provide a `https://developer.android.com/reference/android/app/PendingIntent` for the activity
itself.

As of `https://developer.android.com/reference/android/os/Build.VERSION_CODES#HONEYCOMB`, if this field is unset and you
have specified a custom RemoteViews with `https://developer.android.com/reference/android/app/Notification.Builder#setContent(android.widget.RemoteViews)`, you can use
`https://developer.android.com/reference/android/widget/RemoteViews#setOnClickPendingIntent(int,%20android.app.PendingIntent)`
to assign PendingIntents to individual views in that custom layout (i.e., to create
clickable buttons inside the notification view).

<br />

| Parameters ||
|---|---|
| `intent` | `PendingIntent` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#contentIntent`

### setContentText

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setContentText (CharSequence text)
```

Set the second line of text in the platform notification template.

<br />

| Parameters ||
|---|---|
| `text` | `CharSequence` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setContentTitle

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setContentTitle (CharSequence title)
```

Set the first line of text in the platform notification template.

<br />

| Parameters ||
|---|---|
| `title` | `CharSequence` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setCustomBigContentView

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setCustomBigContentView (RemoteViews contentView)
```

Supply custom RemoteViews to use instead of the platform template in the expanded form.

This will override the expanded layout that would otherwise be constructed by this
Builder object.

Note: The maximum memory use of view hierarchy is limited to 5MB.

<br />

| Parameters ||
|---|---|
| `contentView` | `RemoteViews` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setCustomContentView

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setCustomContentView (RemoteViews contentView)
```

Supply custom RemoteViews to use instead of the platform template.

This will override the layout that would otherwise be constructed by this Builder
object.

Note: The maximum memory use of view hierarchy is limited to 5MB.

<br />

| Parameters ||
|---|---|
| `contentView` | `RemoteViews` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setCustomHeadsUpContentView

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setCustomHeadsUpContentView (RemoteViews contentView)
```

Supply custom RemoteViews to use instead of the platform template in the heads up dialog.

This will override the heads-up layout that would otherwise be constructed by this
Builder object.

Note: The maximum memory use of view hierarchy is limited to 5MB.

<br />

| Parameters ||
|---|---|
| `contentView` | `RemoteViews` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setDefaults

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setDefaults (int defaults)
```


**This method was deprecated
in API level 26.**   

use `https://developer.android.com/reference/android/app/NotificationChannel#enableVibration(boolean)` and
`https://developer.android.com/reference/android/app/NotificationChannel#enableLights(boolean)` and
`https://developer.android.com/reference/android/app/NotificationChannel#setSound(android.net.Uri,%20android.media.AudioAttributes)` instead.

Set which notification properties will be inherited from system defaults.


The value should be one or more of the following fields combined with
bitwise-or:
`https://developer.android.com/reference/android/app/Notification#DEFAULT_SOUND`, `https://developer.android.com/reference/android/app/Notification#DEFAULT_VIBRATE`, `https://developer.android.com/reference/android/app/Notification#DEFAULT_LIGHTS`.


For all default values, use `https://developer.android.com/reference/android/app/Notification#DEFAULT_ALL`.

<br />

| Parameters ||
|---|---|
| `defaults` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | <br /> |

### setDeleteIntent

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setDeleteIntent (PendingIntent intent)
```

Supply a `https://developer.android.com/reference/android/app/PendingIntent` to send when the notification is cleared explicitly by the user.

<br />

| Parameters ||
|---|---|
| `intent` | `PendingIntent` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#deleteIntent`

### setExtras

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setExtras (Bundle extras)
```

Set metadata for this notification.

A reference to the Bundle is held for the lifetime of this Builder, and the Bundle's
current contents are copied into the Notification each time `https://developer.android.com/reference/android/app/Notification.Builder#build()` is
called.

Replaces any existing extras values with those from the provided Bundle.
Use `https://developer.android.com/reference/android/app/Notification.Builder#addExtras(android.os.Bundle)` to merge in metadata instead.

<br />

| Parameters ||
|---|---|
| `extras` | `Bundle` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#extras`

### setFlag

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setFlag (int mask, 
                boolean value)
```

Set the value for a notification flag

<br />

| Parameters ||
|---|---|
| `mask` | `int`: Bit mask of the flag. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/app/Notification#FLAG_SHOW_LIGHTS` - `https://developer.android.com/reference/android/app/Notification#FLAG_ONGOING_EVENT` - `https://developer.android.com/reference/android/app/Notification#FLAG_INSISTENT` - `https://developer.android.com/reference/android/app/Notification#FLAG_ONLY_ALERT_ONCE` - `https://developer.android.com/reference/android/app/Notification#FLAG_AUTO_CANCEL` - `https://developer.android.com/reference/android/app/Notification#FLAG_NO_CLEAR` - `https://developer.android.com/reference/android/app/Notification#FLAG_FOREGROUND_SERVICE` - `https://developer.android.com/reference/android/app/Notification#FLAG_HIGH_PRIORITY` - `https://developer.android.com/reference/android/app/Notification#FLAG_LOCAL_ONLY` - `https://developer.android.com/reference/android/app/Notification#FLAG_GROUP_SUMMARY` - `https://developer.android.com/reference/android/app/Notification#FLAG_BUBBLE` - `https://developer.android.com/reference/android/app/Notification#FLAG_PROMOTED_ONGOING` |
| `value` | `boolean`: Status (on/off) of the flag <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | the same Builder. This value cannot be `null`. <br /> |

### setForegroundServiceBehavior

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setForegroundServiceBehavior (int behavior)
```

Specify a desired visibility policy for a Notification associated with a
foreground service. By default, the system can choose to defer
visibility of the notification for a short time after the service is
started. Pass
`https://developer.android.com/reference/android/app/Notification#FOREGROUND_SERVICE_IMMEDIATE`
to this method in order to guarantee that visibility is never deferred. Pass
`https://developer.android.com/reference/android/app/Notification#FOREGROUND_SERVICE_DEFERRED`
to request that visibility is deferred whenever possible.

Note that deferred visibility is not guaranteed. There
may be some circumstances under which the system will show the foreground
service's associated Notification immediately even when the app has used
this method to explicitly request deferred display.

<br />

<br />

| Parameters ||
|---|---|
| `behavior` | `int`: One of `https://developer.android.com/reference/android/app/Notification#FOREGROUND_SERVICE_DEFAULT`, `https://developer.android.com/reference/android/app/Notification#FOREGROUND_SERVICE_IMMEDIATE`, or `https://developer.android.com/reference/android/app/Notification#FOREGROUND_SERVICE_DEFERRED` Value is one of the following: - `https://developer.android.com/reference/android/app/Notification#FOREGROUND_SERVICE_DEFAULT` - `https://developer.android.com/reference/android/app/Notification#FOREGROUND_SERVICE_IMMEDIATE` - `https://developer.android.com/reference/android/app/Notification#FOREGROUND_SERVICE_DEFERRED` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setFullScreenIntent

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setFullScreenIntent (PendingIntent intent, 
                boolean highPriority)
```

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.

Apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` and above will have to request
a permission (`https://developer.android.com/reference/android/Manifest.permission#USE_FULL_SCREEN_INTENT`) in order to
use full screen intents.


Prior to `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`, the system may display a
heads up notification (which may display on screen longer than other heads up
notifications), instead of launching the intent, while the user is using the device.
From `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`,
the system UI will display a heads up notification, instead of launching this intent,
while the user is using the device. This notification will display with emphasized
action buttons. If the posting app holds
`https://developer.android.com/reference/android/Manifest.permission#USE_FULL_SCREEN_INTENT`, then the heads
up notification will appear persistently until the user dismisses or snoozes it, or
the app cancels it. If the posting app does not hold
`https://developer.android.com/reference/android/Manifest.permission#USE_FULL_SCREEN_INTENT`, then the notification will
appear as heads up notification even when the screen is locked or turned off, and this
notification will only be persistent for 60 seconds.


To be launched as a full screen intent, the notification must also be posted to a
channel with importance level set to IMPORTANCE_HIGH or higher.
.   
Requires `https://developer.android.com/reference/android/Manifest.permission#USE_FULL_SCREEN_INTENT`

<br />

<br />

| Parameters ||
|---|---|
| `intent` | `PendingIntent`: the pending intent to launch <br /> |
| `highPriority` | `boolean`: Passing `true` will cause this notification to be sent even if other notifications are suppressed <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#fullScreenIntent`

### setGroup

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setGroup (String groupKey)
```

Set this notification to be part of a group of notifications sharing the same key.
Grouped notifications may display in a cluster or stack on devices which
support such rendering.

To make this notification the summary for its group, also call
`https://developer.android.com/reference/android/app/Notification.Builder#setGroupSummary(boolean)`. A sort order can be specified for group members by using
`https://developer.android.com/reference/android/app/Notification.Builder#setSortKey(java.lang.String)`.

<br />

| Parameters ||
|---|---|
| `groupKey` | `String`: the group key of the group <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | this object for method chaining. This value cannot be `null`. <br /> |

### setGroupAlertBehavior

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setGroupAlertBehavior (int groupAlertBehavior)
```

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
`https://developer.android.com/reference/android/app/Notification.Builder#setGroup(java.lang.String)`. 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 and/or peek
on screen, all children in the group should have the group alert behavior
`https://developer.android.com/reference/android/app/Notification#GROUP_ALERT_SUMMARY`.

The default value is `https://developer.android.com/reference/android/app/Notification#GROUP_ALERT_ALL`.

<br />

<br />

| Parameters ||
|---|---|
| `groupAlertBehavior` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/app/Notification#GROUP_ALERT_ALL` - `https://developer.android.com/reference/android/app/Notification#GROUP_ALERT_CHILDREN` - `https://developer.android.com/reference/android/app/Notification#GROUP_ALERT_SUMMARY` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setGroupSummary

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setGroupSummary (boolean isGroupSummary)
```

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. Requires a group key also be set using `https://developer.android.com/reference/android/app/Notification.Builder#setGroup(java.lang.String)`.
The group summary may be suppressed if too few notifications are included in the group.

<br />

| Parameters ||
|---|---|
| `isGroupSummary` | `boolean`: whether this notification should be a group summary <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | this object for method chaining. This value cannot be `null`. <br /> |

### setHasSummarizedContent

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public Notification.Builder setHasSummarizedContent (boolean hasSummarizedContent)
```

Sets whether this notification contains text that was computationally summarized from
other sources. The OS may choose to display this notification with different styling or
choose not to summarize this content if this is true.

<br />

| Parameters ||
|---|---|
| `hasSummarizedContent` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setLargeIcon

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setLargeIcon (Bitmap b)
```

Add a large icon to the notification content view.

In the platform template, this image will be shown either on the right of the
notification, with an aspect ratio of up to 16:9, or on the left when the notification
is grouped.

<br />

| Parameters ||
|---|---|
| `b` | `Bitmap` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setLargeIcon

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setLargeIcon (Icon icon)
```

Add a large icon to the notification content view.

In the platform template, this image will be shown either on the right of the
notification, with an aspect ratio of up to 16:9, or on the left when the notification
is grouped.

<br />

| Parameters ||
|---|---|
| `icon` | `Icon` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setLights

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setLights (int argb, 
                int onMs, 
                int offMs)
```


**This method was deprecated
in API level 26.**   

use `https://developer.android.com/reference/android/app/NotificationChannel#enableLights(boolean)` instead.

Set the desired color for the indicator LED on the device, as well as the
blink duty cycle (specified in milliseconds).

Not all devices will honor all (or even any) of these values.

<br />

| Parameters ||
|---|---|
| `argb` | `int` <br /> |
| `onMs` | `int` <br /> |
| `offMs` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#ledARGB`
- `https://developer.android.com/reference/android/app/Notification#ledOnMS`
- `https://developer.android.com/reference/android/app/Notification#ledOffMS`

### setLocalOnly

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setLocalOnly (boolean localOnly)
```

Set whether or not this notification should not bridge to other devices.

Some notifications can be bridged to other devices for remote display.
This hint can be set to recommend this notification not be bridged.

<br />

| Parameters ||
|---|---|
| `localOnly` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setLocusId

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setLocusId (LocusId locusId)
```

Sets the `https://developer.android.com/reference/android/content/LocusId` associated with this notification.

This method should be called when the `https://developer.android.com/reference/android/content/LocusId` is used in other places (such
as `https://developer.android.com/reference/android/content/pm/ShortcutInfo` and `https://developer.android.com/reference/android/view/contentcapture/ContentCaptureContext`) so the device's intelligence
services can correlate them.

<br />

| Parameters ||
|---|---|
| `locusId` | `LocusId`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setNumber

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setNumber (int number)
```

Sets the number of items this notification represents. May be displayed as a badge count
for Launchers that support badging.

<br />

| Parameters ||
|---|---|
| `number` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setOngoing

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setOngoing (boolean ongoing)
```

Set whether this is an "ongoing" notification.

Ongoing notifications cannot be dismissed by the user on locked devices, or by
notification listeners, and some notifications (call, device management, media) cannot be
dismissed on unlocked devices, 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).

<br />

| Parameters ||
|---|---|
| `ongoing` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#FLAG_ONGOING_EVENT`

### setOnlyAlertOnce

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setOnlyAlertOnce (boolean onlyAlertOnce)
```

Set this flag if you would only like the sound, vibrate
and ticker to be played if the notification is not already showing.

Note that using this flag will stop any ongoing alerting behaviour such
as sound, vibration or blinking notification LED.

<br />

| Parameters ||
|---|---|
| `onlyAlertOnce` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#FLAG_ONLY_ALERT_ONCE`

### setPriority

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setPriority (int pri)
```


**This method was deprecated
in API level 26.**   

use `https://developer.android.com/reference/android/app/NotificationChannel#setImportance(int)` instead.

Set the priority of this notification.

<br />

| Parameters ||
|---|---|
| `pri` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/app/Notification#PRIORITY_DEFAULT` - `https://developer.android.com/reference/android/app/Notification#PRIORITY_LOW` - `https://developer.android.com/reference/android/app/Notification#PRIORITY_MIN` - `https://developer.android.com/reference/android/app/Notification#PRIORITY_HIGH` - `https://developer.android.com/reference/android/app/Notification#PRIORITY_MAX` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#priority`

### setProgress

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setProgress (int max, 
                int progress, 
                boolean indeterminate)
```

Set the progress this notification represents.

The platform template will represent this using a `https://developer.android.com/reference/android/widget/ProgressBar`.

<br />

| Parameters ||
|---|---|
| `max` | `int` <br /> |
| `progress` | `int` <br /> |
| `indeterminate` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setPublicVersion

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setPublicVersion (Notification n)
```

Supply a replacement Notification whose contents should be shown in insecure contexts
(i.e. atop the secure lockscreen). See `https://developer.android.com/reference/android/app/Notification#visibility` and `https://developer.android.com/reference/android/app/Notification#VISIBILITY_PUBLIC`.

<br />

| Parameters ||
|---|---|
| `n` | `Notification`: a replacement notification, presumably with some or all info redacted <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | the same Builder. This value cannot be `null`. <br /> |

### setRemoteInputHistory

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setRemoteInputHistory (CharSequence[] text)
```

Set the remote input history.

This should be set to the most recent inputs that have been sent
through a `https://developer.android.com/reference/android/app/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`.

<br />

<br />

| Parameters ||
|---|---|
| `text` | `CharSequence` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setRequestPromotedOngoing

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public Notification.Builder setRequestPromotedOngoing (boolean requestPromotedOngoing)
```

Set whether this notification is requesting to be a promoted ongoing notification.

This is the first requirement of `https://developer.android.com/reference/android/app/Notification#hasPromotableCharacteristics()`.

<br />

| Parameters ||
|---|---|
| `requestPromotedOngoing` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#EXTRA_REQUEST_PROMOTED_ONGOING`
- `https://developer.android.com/reference/android/app/Notification#isRequestPromotedOngoing()`

### setSettingsText

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setSettingsText (CharSequence text)
```

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

This text does not appear within notification `https://developer.android.com/reference/android/app/Notification.Style` 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 `https://developer.android.com/reference/android/app/Notification#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.

<br />

| Parameters ||
|---|---|
| `text` | `CharSequence` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setShortCriticalText

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setShortCriticalText (String shortCriticalText)
```

Sets a very short string summarizing the most critical information contained in the
notification. Suggested max length is 7 characters, and there is no guarantee how much or
how little of this text will be shown.

This field is designed exclusively for the compact representation (hereafter "chip")
shown when the notification is `https://developer.android.com/reference/android/app/Notification#FLAG_PROMOTED_ONGOING`.

- A chip's content may not be shown in certain states or if it cannot fit.
- Short critical text will always be the highest precedence content for a chip.
- Setting this to `""` will ensure the chip has no content; `null` (the default) will fall back to the other options.
- A `https://developer.android.com/reference/android/app/Notification.MetricStyle`'s critical metric is the next option for the chip's content.
- A time (from `https://developer.android.com/reference/android/app/Notification#when`) is the final source of content for the chip.
  - If `https://developer.android.com/reference/android/app/Notification.Builder#setUsesChronometer(boolean)` is `true`, the chip content will be a chronometer, if that is positive (based on `https://developer.android.com/reference/android/app/Notification.Builder#setChronometerCountDown(boolean)`).
  - If `https://developer.android.com/reference/android/app/Notification.Builder#setShowWhen(boolean)` is true, the chip content will be the time remaining until `https://developer.android.com/reference/android/app/Notification#when`, if positive.

<br />

<br />

| Parameters ||
|---|---|
| `shortCriticalText` | `String`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | <br /> |

### setShortcutId

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setShortcutId (String shortcutId)
```

From Android 11, messaging notifications (those that use `https://developer.android.com/reference/android/app/Notification.MessagingStyle`) that
use this method to link to a published long-lived sharing shortcut may appear in a
dedicated Conversation section of the shade and may show configuration options that
are unique to conversations. This behavior should be reserved for person to person(s)
conversations where there is a likely social obligation for an individual to respond.


For example, the following are some examples of notifications that belong in the
conversation space:

- 1:1 conversations between two individuals
- Group conversations between individuals where everyone can contribute

And the following are some examples of notifications that do not belong in the conversation space:

<!-- -->

- Advertisements from a bot (even if personal and contextualized)
- Engagement notifications from a bot
- Directional conversations where there is an active speaker and many passive individuals
- Stream / posting updates from other individuals
- Email, document comments, or other conversation types that are not real-time

<br />


Additionally, this method can be used for all types of notifications to mark this
notification as duplicative of a Launcher shortcut. Launchers that show badges or
notification content may then suppress the shortcut in favor of the content of this
notification.


If this notification has `https://developer.android.com/reference/android/app/Notification.BubbleMetadata` attached that was created with
a shortcutId a check will be performed to ensure the shortcutId supplied to bubble
metadata matches the shortcutId set here, if one was set. If the shortcutId's were
specified but do not match, an exception is thrown.

<br />

| Parameters ||
|---|---|
| `shortcutId` | `String`: the `https://developer.android.com/reference/android/content/pm/ShortcutInfo#getId()` of the shortcut this notification is linked to <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.BubbleMetadata.Builder#Builder(java.lang.String)`

### setShowWhen

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setShowWhen (boolean show)
```

Control whether the timestamp set with `https://developer.android.com/reference/android/app/Notification.Builder#setWhen(long)` is shown
in the content view.

<br />

| Parameters ||
|---|---|
| `show` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setSmallIcon

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setSmallIcon (int icon, 
                int level)
```

A variant of `https://developer.android.com/reference/android/app/Notification.Builder#setSmallIcon(int)` that takes an additional
level parameter for when the icon is a `https://developer.android.com/reference/android/graphics/drawable/LevelListDrawable`.

<br />

| Parameters ||
|---|---|
| `icon` | `int`: a resource ID in the application's package of the drawable to use <br /> |
| `level` | `int`: the level to use for the icon <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#icon`
- `https://developer.android.com/reference/android/app/Notification#iconLevel`

### setSmallIcon

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setSmallIcon (int icon)
```

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
`https://developer.android.com/reference/android/app/Notification.Builder#setLargeIcon(android.graphics.Bitmap)` has also been specified, in which case the small
icon will be moved to the right-hand side.

<br />

| Parameters ||
|---|---|
| `icon` | `int`: A resource ID in the application's package of the drawable to use. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#icon`

### setSmallIcon

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setSmallIcon (Icon icon)
```

Set the small icon, which will be used to represent the notification in the
status bar.

<br />

| Parameters ||
|---|---|
| `icon` | `Icon`: an Icon object to use <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#icon`

### setSortKey

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setSortKey (String sortKey)
```

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
`https://developer.android.com/reference/android/app/Notification.Builder#setGroup(java.lang.String)`.

<br />

| Parameters ||
|---|---|
| `sortKey` | `String` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/java/lang/String#compareTo(java.lang.String)`

### setSound

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setSound (Uri sound, 
                AudioAttributes audioAttributes)
```


**This method was deprecated
in API level 26.**   

use `https://developer.android.com/reference/android/app/NotificationChannel#setSound(android.net.Uri,%20android.media.AudioAttributes)` instead.

Set the sound to play, along with specific `https://developer.android.com/reference/android/media/AudioAttributes` to
use during playback.

<br />

| Parameters ||
|---|---|
| `sound` | `Uri` <br /> |
| `audioAttributes` | `AudioAttributes` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#sound`

### setSound

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setSound (Uri sound)
```


**This method was deprecated
in API level 26.**   

use `https://developer.android.com/reference/android/app/NotificationChannel#setSound(android.net.Uri,%20android.media.AudioAttributes)` instead.

Set the sound to play.

It will be played using the `https://developer.android.com/reference/android/app/Notification#AUDIO_ATTRIBUTES_DEFAULT`
for notifications.

<br />

| Parameters ||
|---|---|
| `sound` | `Uri` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | <br /> |

### setSound

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setSound (Uri sound, 
                int streamType)
```


**This method was deprecated
in API level 21.**   

use `https://developer.android.com/reference/android/app/NotificationChannel#setSound(android.net.Uri,%20android.media.AudioAttributes)`.

Set the sound to play, along with a specific stream on which to play it.

See `https://developer.android.com/reference/android/media/AudioManager` for the `STREAM_` constants.

<br />

| Parameters ||
|---|---|
| `sound` | `Uri` <br /> |
| `streamType` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | <br /> |

### setStyle

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setStyle (Notification.Style style)
```

Add a rich notification style to be applied at build time.

<br />

| Parameters ||
|---|---|
| `style` | `Notification.Style`: object responsible for modifying the notification style <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setSubText

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setSubText (CharSequence text)
```

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 `https://developer.android.com/reference/android/os/Build.VERSION_CODES#N` this information is displayed in the
notification header area.

On Android versions before `https://developer.android.com/reference/android/os/Build.VERSION_CODES#N`
this will be shown in the third line of text in the platform notification template.
You should not be using `https://developer.android.com/reference/android/app/Notification.Builder#setProgress(int,%20int,%20boolean)` at the
same time on those versions; they occupy the same place.

<br />

| Parameters ||
|---|---|
| `text` | `CharSequence` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setTicker

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setTicker (CharSequence tickerText, 
                RemoteViews views)
```

Obsolete version of `https://developer.android.com/reference/android/app/Notification.Builder#setTicker(java.lang.CharSequence)`.

<br />

| Parameters ||
|---|---|
| `tickerText` | `CharSequence` <br /> |
| `views` | `RemoteViews` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | <br /> |

### setTicker

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setTicker (CharSequence tickerText)
```

Set the "ticker" text which is sent to accessibility services.

<br />

| Parameters ||
|---|---|
| `tickerText` | `CharSequence` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#tickerText`

### setTimeoutAfter

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setTimeoutAfter (long durationMs)
```

Specifies a duration in milliseconds after which this notification should be canceled,
if it is not already canceled.

<br />

| Parameters ||
|---|---|
| `durationMs` | `long` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

### setUsesChronometer

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setUsesChronometer (boolean b)
```

Show the `https://developer.android.com/reference/android/app/Notification#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
`https://developer.android.com/reference/android/app/Notification.Builder#setChronometerCountDown(boolean)`.

If the notification is `https://developer.android.com/reference/android/app/Notification#FLAG_PROMOTED_ONGOING` then this
stopwatch might also be displayed in its status bar chip.

<br />

| Parameters ||
|---|---|
| `b` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/Chronometer`
- `https://developer.android.com/reference/android/app/Notification#when`
- `https://developer.android.com/reference/android/app/Notification.Builder#setChronometerCountDown(boolean)`

### setVibrate

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setVibrate (long[] pattern)
```


**This method was deprecated
in API level 26.**   

use `https://developer.android.com/reference/android/app/NotificationChannel#setVibrationPattern(long[])` instead.

Set the vibration pattern to use.

See `https://developer.android.com/reference/android/os/Vibrator#vibrate(long[],%20int)` for a discussion of the
`pattern` parameter.


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

<br />

<br />

| Parameters ||
|---|---|
| `pattern` | `long` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#vibrate`

### setVisibility

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setVisibility (int visibility)
```

Specify the value of `https://developer.android.com/reference/android/app/Notification#visibility`.

<br />

| Parameters ||
|---|---|
| `visibility` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/app/Notification#VISIBILITY_PUBLIC` - `https://developer.android.com/reference/android/app/Notification#VISIBILITY_PRIVATE` - `https://developer.android.com/reference/android/app/Notification#VISIBILITY_SECRET` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | the same Builder. This value cannot be `null`. <br /> |

### setWhen

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.Builder setWhen (long when)
```

Add a timestamp pertaining to the notification (usually the time the event occurred).

<br />

| Parameters ||
|---|---|
| `when` | `long` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification#when`