Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

Request

class Request
kotlin.Any
   ↳ androidx.textclassifier.TextLinks.Request

A request object for generating TextLinks.

Summary

Nested classes

A builder for building TextLinks requests.

Public methods

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

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

LocaleListCompat?

TextClassifier.EntityConfig

Bundle

Returns the extended, vendor specific data.

Long?

CharSequence

Returns the text to generate links for.

Bundle

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

Public methods

createFromBundle

@NonNull static fun createFromBundle(@NonNull bundle: Bundle): TextLinks.Request

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

getDefaultLocales

@Nullable fun getDefaultLocales(): LocaleListCompat?
Return
LocaleListCompat?: ordered list of locale preferences that can be used to disambiguate the provided text

getEntityConfig

@NonNull fun getEntityConfig(): TextClassifier.EntityConfig
Return
TextClassifier.EntityConfig: The config representing the set of entities to look for

getExtras

@NonNull fun getExtras(): Bundle

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

@Nullable fun getReferenceTime(): Long?
Return
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

@NonNull fun getText(): CharSequence

Returns the text to generate links for.

toBundle

@NonNull fun toBundle(): Bundle

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