Register now for Android Dev Summit 2019!

TextClassificationContext

public final class TextClassificationContext
extends Object

java.lang.Object
   ↳ androidx.textclassifier.TextClassificationContext


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

Summary

Nested classes

class TextClassificationContext.Builder

A builder for building a TextClassification context. 

Public methods

static TextClassificationContext createFromBundle(Bundle bundle)

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

String getPackageName()

Returns the package name for the calling package.

String getWidgetType()

Returns the widget type for this classification context.

String getWidgetVersion()

Returns a custom version string for the widget type.

Bundle toBundle()

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

String toString()

Inherited methods

Public methods

createFromBundle

public static TextClassificationContext createFromBundle (Bundle bundle)

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

Parameters
bundle Bundle

Returns
TextClassificationContext

getPackageName

public String getPackageName ()

Returns the package name for the calling package.

Returns
String

getWidgetType

public String getWidgetType ()

Returns the widget type for this classification context.

Returns
String

getWidgetVersion

public String getWidgetVersion ()

Returns a custom version string for the widget type.

Returns
String

See also:

toBundle

public Bundle toBundle ()

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

Returns
Bundle

toString

public String toString ()

Returns
String