public final class

TextSelection.Request

extends java.lang.Object

 java.lang.Object

↳androidx.textclassifier.TextSelection.Request

Overview

A request object for generating TextSelection.

Summary

Methods
public static TextSelection.RequestcreateFromBundle(Bundle bundle)

Extracts a Request from a bundle that was added using TextSelection.Request.toBundle().

public LocaleListCompatgetDefaultLocales()

public intgetEndIndex()

Returns end index of the selected part of text.

public BundlegetExtras()

Returns the extended, vendor specific data.

public intgetStartIndex()

Returns start index of the selected part of text.

public java.lang.CharSequencegetText()

Returns the text providing context for the selected text (which is specified by the sub sequence starting at startIndex and ending at endIndex).

public BundletoBundle()

Adds this Request to a Bundle that can be read back with the same parameters to TextSelection.Request.createFromBundle(Bundle).

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

Methods

public java.lang.CharSequence getText()

Returns the text providing context for the selected text (which is specified by the sub sequence starting at startIndex and ending at endIndex).

public int getStartIndex()

Returns start index of the selected part of text.

public int getEndIndex()

Returns end index of the selected part of text.

public LocaleListCompat getDefaultLocales()

Returns:

ordered list of locale preferences that can be used to disambiguate the provided text.

public Bundle getExtras()

Returns the extended, vendor specific data.

NOTE: Each call to this method returns a new bundle copy so clients should prefer to hold a reference to the returned bundle rather than frequently calling this method. Avoid updating the content of this bundle. On pre-O devices, the values in the Bundle are not deep copied.

public Bundle toBundle()

Adds this Request to a Bundle that can be read back with the same parameters to TextSelection.Request.createFromBundle(Bundle).

public static TextSelection.Request createFromBundle(Bundle bundle)

Extracts a Request from a bundle that was added using TextSelection.Request.toBundle().