public final class TextLinks.Request


A request object for generating TextLinks.

Summary

Nested types

public final class TextLinks.Request.Builder

This class is deprecated.

Use android.view.textclassifier.TextLinks.Builder instead.

Public methods

static @NonNull TextLinks.Request

Extracts a Request from a bundle that was added using toBundle.

@Nullable LocaleListCompat
@NonNull TextClassifier.EntityConfig
@NonNull Bundle

Returns the extended, vendor specific data.

@Nullable Long
@NonNull CharSequence

Returns the text to generate links for.

@NonNull Bundle

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

Public methods

createFromBundle

public static @NonNull TextLinks.Request createFromBundle(@NonNull Bundle bundle)

Extracts a Request from a bundle that was added using toBundle.

getDefaultLocales

public @Nullable LocaleListCompat getDefaultLocales()
Returns
@Nullable LocaleListCompat

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

getEntityConfig

public @NonNull TextClassifier.EntityConfig getEntityConfig()
Returns
@NonNull TextClassifier.EntityConfig

The config representing the set of entities to look for

See also
setEntityConfig

getExtras

public @NonNull 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.

getReferenceTime

public @Nullable Long getReferenceTime()
Returns
@Nullable Long

reference time based on which relative dates (e.g. "tomorrow") should be interpreted. This should be milliseconds from the epoch of 1970-01-01T00:00:00Z(UTC timezone).

getText

public @NonNull CharSequence getText()

Returns the text to generate links for.

toBundle

public @NonNull Bundle toBundle()

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