public final class

TextSelection.Request.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.textclassifier.TextSelection.Request.Builder

Overview

A builder for building TextSelection requests.

Summary

Constructors
publicBuilder(java.lang.CharSequence text, int startIndex, int endIndex)

Methods
public TextSelection.Requestbuild()

Builds and returns the request object.

public TextSelection.Request.BuildersetDefaultLocales(LocaleListCompat defaultLocales)

public TextSelection.Request.BuildersetExtras(Bundle extras)

Sets the extended, vendor specific data.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(java.lang.CharSequence text, int startIndex, int endIndex)

Parameters:

text: text providing context for the selected text (which is specified by the sub sequence starting at selectionStartIndex and ending at selectionEndIndex)
startIndex: start index of the selected part of text
endIndex: end index of the selected part of text

Methods

public TextSelection.Request.Builder setDefaultLocales(LocaleListCompat defaultLocales)

Parameters:

defaultLocales: ordered list of locale preferences that may be used to disambiguate the provided text. If no locale preferences exist, set this to null or an empty locale list.

Returns:

this builder.

public TextSelection.Request.Builder setExtras(Bundle extras)

Sets the extended, vendor specific data.

Returns:

this builder

public TextSelection.Request build()

Builds and returns the request object.