Added in API level 29

Builder

class Builder
kotlin.Any
   ↳ android.view.contentcapture.ContentCaptureContext.Builder

Builder for ContentCaptureContext objects.

Summary

Public constructors

Creates a new builder.

Public methods
ContentCaptureContext

Builds the ContentCaptureContext.

ContentCaptureContext.Builder
setExtras(extras: Bundle)

Sets extra options associated with this context.

Public constructors

Builder

Added in API level 29
Builder(id: LocusId)

Creates a new builder.

The context must have an id, which is usually one of the following:

  • A URL representing a web page (or IFRAME) that's being rendered by the activity (See View#setContentCaptureSession(ContentCaptureSession) for an example).
  • A unique identifier of the application state (for example, a conversation between 2 users in a chat app).

See ContentCaptureManager for more info about the content capture context.

Parameters
id LocusId: id associated with this context. This value cannot be null.

Public methods

build

Added in API level 29
fun build(): ContentCaptureContext

Builds the ContentCaptureContext.

Return
ContentCaptureContext the built ContentCaptureContext This value cannot be null.
Exceptions
java.lang.IllegalStateException if build() was already called.

setExtras

Added in API level 29
fun setExtras(extras: Bundle): ContentCaptureContext.Builder

Sets extra options associated with this context.

It can be used to provide vendor-specific data that can be modified and examined.

Parameters
extras Bundle: extra options. This value cannot be null.
Return
ContentCaptureContext.Builder this builder. This value cannot be null.
Exceptions
java.lang.IllegalStateException if build() was already called.