The Android Developer Challenge is back! Submit your idea before December 2.

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

static TextClassificationContext
createFromBundle(@NonNull bundle: Bundle)

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

String

Returns the package name for the calling package.

String

Returns the widget type for this classification context.

String?

Returns a custom version string for the widget type.

Bundle

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

String

Public methods

createFromBundle

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

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

getPackageName

@NonNull fun getPackageName(): String

Returns the package name for the calling package.

getWidgetType

@NonNull fun getWidgetType(): String

Returns the widget type for this classification context.

getWidgetVersion

@Nullable fun getWidgetVersion(): String?

Returns a custom version string for the widget type.

See Also

toBundle

@NonNull fun toBundle(): Bundle

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

toString

fun toString(): String