Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

TextClassificationContext

class TextClassificationContext
kotlin.Any
   ↳ androidx.textclassifier.TextClassificationContext

A representation of the context in which text classification would be performed.

Summary

Nested classes

A builder for building a TextClassification context.

Public methods
String

Returns the widget type for this classification context.

String

Bundle

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

String?

Returns a custom version string for the widget type.

String

Returns the package name for the calling package.

static TextClassificationContext
createFromBundle(@NonNull bundle: Bundle)

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

Public methods

getWidgetType

@NonNull fun getWidgetType(): String

Returns the widget type for this classification context.

toString

fun toString(): String

toBundle

@NonNull fun toBundle(): Bundle

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

getWidgetVersion

@Nullable fun getWidgetVersion(): String?

Returns a custom version string for the widget type.

See Also

getPackageName

@NonNull fun getPackageName(): String

Returns the package name for the calling package.

createFromBundle

@NonNull static fun createFromBundle(@NonNull bundle: Bundle): TextClassificationContext

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