ContentCaptureContext.Builder


public static final class ContentCaptureContext.Builder
extends Object

java.lang.Object
   ↳ android.view.contentcapture.ContentCaptureContext.Builder


Builder for ContentCaptureContext objects.

Summary

Public constructors

Builder(LocusId id)

Creates a new builder.

Public methods

ContentCaptureContext build()

Builds the ContentCaptureContext.

ContentCaptureContext.Builder setExtras(Bundle extras)

Sets extra options associated with this context.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

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

void finalize()

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

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

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

final void notifyAll()

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

String toString()

Returns a string representation of the object.

final void wait(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 wait(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 wait()

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

Public constructors

Builder

Added in API level 29
public Builder (LocusId id)

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
public ContentCaptureContext build ()

Builds the ContentCaptureContext.

Returns
ContentCaptureContext the built ContentCaptureContext This value cannot be null.

Throws
IllegalStateException if build() was already called.

setExtras

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

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.

Returns
ContentCaptureContext.Builder this builder. This value cannot be null.

Throws
IllegalStateException if build() was already called.