ContentInfoCompat.Builder

Added in 1.5.0

public final class ContentInfoCompat.Builder


Builder for ContentInfoCompat.

Summary

Public constructors

Creates a new builder initialized with the data from the given object (shallow copy).

Builder(@NonNull ClipData clip, int source)

Creates a new builder.

Public methods

@NonNull ContentInfoCompat
@NonNull ContentInfoCompat.Builder

Sets the data to be inserted.

@NonNull ContentInfoCompat.Builder

Sets additional metadata.

@NonNull ContentInfoCompat.Builder
setFlags(int flags)

Sets flags that control content insertion behavior.

@NonNull ContentInfoCompat.Builder

Sets the http/https URI for the content.

@NonNull ContentInfoCompat.Builder
setSource(int source)

Sets the source of the operation.

Public constructors

Builder

Added in 1.5.0
public Builder(@NonNull ContentInfoCompat other)

Creates a new builder initialized with the data from the given object (shallow copy).

Builder

Added in 1.5.0
public Builder(@NonNull ClipData clip, int source)

Creates a new builder.

Parameters
@NonNull ClipData clip

The data to insert.

int source

The source of the operation. See SOURCE_ constants.

Public methods

build

Added in 1.5.0
public @NonNull ContentInfoCompat build()
Returns
@NonNull ContentInfoCompat

A new ContentInfoCompat instance with the data from this builder.

setClip

Added in 1.5.0
public @NonNull ContentInfoCompat.Builder setClip(@NonNull ClipData clip)

Sets the data to be inserted.

Parameters
@NonNull ClipData clip

The data to insert.

Returns
@NonNull ContentInfoCompat.Builder

this builder

setExtras

Added in 1.5.0
public @NonNull ContentInfoCompat.Builder setExtras(@Nullable Bundle extras)

Sets additional metadata.

Parameters
@Nullable Bundle extras

Optional bundle with additional metadata.

Returns
@NonNull ContentInfoCompat.Builder

this builder

setFlags

Added in 1.5.0
public @NonNull ContentInfoCompat.Builder setFlags(int flags)

Sets flags that control content insertion behavior.

Parameters
int flags

Optional flags to configure the insertion behavior. Use 0 for default behavior. See FLAG_ constants.

Returns
@NonNull ContentInfoCompat.Builder

this builder

setLinkUri

Added in 1.5.0
public @NonNull ContentInfoCompat.Builder setLinkUri(@Nullable Uri linkUri)

Sets the http/https URI for the content. See getLinkUri for more info.

Parameters
@Nullable Uri linkUri

Optional http/https URI for the content.

Returns
@NonNull ContentInfoCompat.Builder

this builder

setSource

Added in 1.5.0
public @NonNull ContentInfoCompat.Builder setSource(int source)

Sets the source of the operation.

Parameters
int source

The source of the operation. See SOURCE_ constants.

Returns
@NonNull ContentInfoCompat.Builder

this builder