Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

Builder

open class Builder
kotlin.Any
   ↳ androidx.core.app.NotificationCompat.Builder

Builder class for NotificationCompat objects. Allows easier control over all the flags, as well as help constructing the typical notification layouts.

On platform versions that don't offer expanded notifications, methods that depend on expanded notifications have no effect.

For example, action buttons won't appear on platforms prior to Android 4.1. Action buttons depend on expanded notifications, which are only available in Android 4.1 and later.

For this reason, you should always ensure that UI controls in a notification are also available in an android.app.Activity in your app, and you should always start that android.app.Activity when users click the notification. To do this, use the setContentIntent() method.

Summary

Public constructors
<init>(@NonNull context: Context, @NonNull notification: Notification)

Creates a NotificationCompat.

<init>(@NonNull context: Context, @NonNull channelId: String)

Constructor.

<init>(@NonNull context: Context)

Public methods
open NotificationCompat.Builder
addAction(icon: Int, @Nullable title: CharSequence?, @Nullable intent: PendingIntent?)

Add an action to this notification.

open NotificationCompat.Builder

Add an action to this notification.

open NotificationCompat.Builder
addExtras(@Nullable extras: Bundle?)

Merge additional metadata into this notification.

open NotificationCompat.Builder
addInvisibleAction(icon: Int, @Nullable title: CharSequence?, @Nullable intent: PendingIntent?)

Add an invisible action to this notification.

open NotificationCompat.Builder

Add an invisible action to this notification.

open NotificationCompat.Builder
addPerson(@Nullable uri: String?)

Add a person that is relevant to this notification.

open NotificationCompat.Builder
addPerson(@Nullable person: Person?)

Add a person that is relevant to this notification.

open Notification

Combine all of the options that have been set and return a new Notification object.

open NotificationCompat.Builder

Clear any actions added via #addAction

open NotificationCompat.Builder

Clear any invisible actions added via #addInvisibleAction

open NotificationCompat.Builder

Clear any people added via either addPerson(Person) or addPerson(String)

open RemoteViews?

Construct a RemoteViews for the final big notification layout.

open RemoteViews?

Construct a RemoteViews for the final notification layout.

open RemoteViews?

Construct a RemoteViews for the final heads-up notification layout.

open NotificationCompat.Builder
extend(@NonNull extender: NotificationCompat.Extender)

Apply an extender to this notification builder.

open Bundle

Get the current metadata Bundle used by this notification Builder.

open Notification

open NotificationCompat.Builder

Determines whether the platform can generate contextual actions for a notification.

open NotificationCompat.Builder
setAutoCancel(autoCancel: Boolean)

Setting this flag will make it so the notification is automatically canceled when the user clicks it in the panel.

open NotificationCompat.Builder

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

open NotificationCompat.Builder

Sets the BubbleMetadata that will be used to display app content in a floating window over the existing foreground activity.

open NotificationCompat.Builder
setCategory(@Nullable category: String?)

Set the notification category.

open NotificationCompat.Builder
setChannelId(@NonNull channelId: String)

Specifies the channel the notification should be delivered on.

open NotificationCompat.Builder

Sets the Chronometer to count down instead of counting up.

open NotificationCompat.Builder
setColor(@ColorInt argb: Int)

Sets Notification#color.

open NotificationCompat.Builder