AppSearchManager.SearchContext.Builder


public static final class AppSearchManager.SearchContext.Builder
extends Object

java.lang.Object
   ↳ android.app.appsearch.AppSearchManager.SearchContext.Builder


Builder for SearchContext objects.

Summary

Public constructors

Builder(String databaseName)

Creates a new SearchContext.Builder.

Public methods

AppSearchManager.SearchContext build()

Builds a SearchContext instance.

Inherited methods

Public constructors

Builder

Added in API level 31
public Builder (String databaseName)

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.

Throws
IllegalArgumentException if the databaseName contains '/'.

Public methods

build

Added in API level 31
public AppSearchManager.SearchContext build ()

Builds a SearchContext instance.

Returns
AppSearchManager.SearchContext This value cannot be null.