Notification.BubbleMetadata.Builder Constructors

Definition

Overloads

Name Description
Notification.BubbleMetadata.Builder()

This constructor is deprecated.

Notification.BubbleMetadata.Builder(String)

Creates a BubbleMetadata.Builder based on a ShortcutInfo.

Notification.BubbleMetadata.Builder(PendingIntent, Icon)

Creates a BubbleMetadata.Builder based on the provided intent and icon.

Notification.BubbleMetadata.Builder()

This constructor is deprecated.

[Android.Runtime.Register(".ctor", "()V", "", ApiSince=29)]
public Builder();
Attributes

Remarks

This constructor is deprecated. use Builder.Builder(String) for a bubble created via a ShortcutInfo or Builder.Builder(PendingIntent,Icon) for a bubble created via a PendingIntent.

Android reference for android.app.Notification.BubbleMetadata.Builder.Builder.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Notification.BubbleMetadata.Builder(String)

Creates a BubbleMetadata.Builder based on a ShortcutInfo.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "", ApiSince=30)]
public Builder(string shortcutId);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "", ApiSince=30)>]
new Android.App.Notification.BubbleMetadata.Builder : string -> Android.App.Notification.BubbleMetadata.Builder

Parameters

shortcutId
String

String: This value cannot be null.

Attributes

Remarks

Creates a BubbleMetadata.Builder based on a ShortcutInfo. To create a shortcut bubble, ensure that the shortcut associated with the provided shortcutId is published as a dynamic shortcut that was built with ShortcutInfo.Builder.setLongLived(boolean) being true, otherwise your notification will not be able to bubble. The shortcut icon will be used to represent the bubble when it is collapsed.

The shortcut activity will be used when the bubble is expanded. This will display the shortcut activity in a floating window over the existing foreground activity.

When the activity is launched from a bubble, Activity.isLaunchedFromBubble() will return with true.

If the shortcut has not been published when the bubble notification is sent, no bubble will be produced. If the shortcut is deleted while the bubble is active, the bubble will be removed.

See also:

Throws: NullPointerException if shortcutId is null.

Android reference for android.app.Notification.BubbleMetadata.Builder.Builder.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Notification.BubbleMetadata.Builder(PendingIntent, Icon)

Creates a BubbleMetadata.Builder based on the provided intent and icon.

[Android.Runtime.Register(".ctor", "(Landroid/app/PendingIntent;Landroid/graphics/drawable/Icon;)V", "", ApiSince=30)]
public Builder(Android.App.PendingIntent intent, Android.Graphics.Drawables.Icon icon);
[<Android.Runtime.Register(".ctor", "(Landroid/app/PendingIntent;Landroid/graphics/drawable/Icon;)V", "", ApiSince=30)>]
new Android.App.Notification.BubbleMetadata.Builder : Android.App.PendingIntent * Android.Graphics.Drawables.Icon -> Android.App.Notification.BubbleMetadata.Builder

Parameters

intent
PendingIntent

PendingIntent: This value cannot be null.

icon
Icon

Icon: This value cannot be null.

Attributes

Remarks

Creates a BubbleMetadata.Builder based on the provided intent and icon. The icon will be used to represent the bubble when it is collapsed. An icon should be representative of the content within the bubble. If your app produces multiple bubbles, the icon should be unique for each of them.

The intent that will be used when the bubble is expanded. This will display the app content in a floating window over the existing foreground activity. The intent should point to a resizable activity.

When the activity is launched from a bubble, Activity.isLaunchedFromBubble() will return with true.

Throws: NullPointerException if intent is null.

Throws: NullPointerException if icon is null.

Android reference for android.app.Notification.BubbleMetadata.Builder.Builder.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to