Added in API level 31

Builder

class Builder
kotlin.Any
   ↳ android.app.appsearch.AppSearchManager.SearchContext.Builder

Builder for SearchContext objects.

Summary

Public constructors
Builder(databaseName: String)

Creates a new SearchContext.Builder.

Public methods
AppSearchManager.SearchContext

Builds a SearchContext instance.

Public constructors

Builder

Added in API level 31
Builder(databaseName: String)

Creates a new SearchContext.Builder.

AppSearchSession will create or open a database under the given name.

Databases with different names are fully separate with distinct types, namespaces, and data.

Database name cannot contain '/'.

Parameters
databaseName String: The name of the database. This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the databaseName contains '/'.

Public methods

build

Added in API level 31
fun build(): AppSearchManager.SearchContext

Builds a SearchContext instance.

Return
AppSearchManager.SearchContext This value cannot be null.