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

TextClassificationContext.Builder

public static final class TextClassificationContext.Builder
extends Object

java.lang.Object
   ↳ androidx.textclassifier.TextClassificationContext.Builder


A builder for building a TextClassification context.

Summary

Public constructors

TextClassificationContext.Builder(String packageName, String widgetType)

Initializes a new builder for text classification context objects.

Public methods

TextClassificationContext build()

Builds the text classification context object.

TextClassificationContext.Builder setWidgetVersion(String widgetVersion)

Sets an optional custom version string for the widget type.

Inherited methods

Public constructors

TextClassificationContext.Builder

public TextClassificationContext.Builder (String packageName, 
                String widgetType)

Initializes a new builder for text classification context objects.

Parameters
packageName String: the name of the calling package

widgetType String: the type of widget e.g. TextClassifier.WIDGET_TYPE_TEXTVIEW

Returns
this builder

Public methods

build

public TextClassificationContext build ()

Builds the text classification context object.

Returns
TextClassificationContext the built TextClassificationContext object

setWidgetVersion

public TextClassificationContext.Builder setWidgetVersion (String widgetVersion)

Sets an optional custom version string for the widget type.

Parameters
widgetVersion String

Returns
TextClassificationContext.Builder this builder