public
final
class
TextClassificationContext
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | android.view.textclassifier.TextClassificationContext |
A representation of the context in which text classification would be performed.
classTextClassificationContext.Builder
A builder for building a TextClassification context.
Inherited constants |
|---|
Fields | |
|---|---|
public
static
final
Creator<TextClassificationContext> |
CREATOR
|
Public methods | |
|---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
String
|
getPackageName()
Returns the package name of the app that this context originated in. |
String
|
getWidgetType()
Returns the widget type for this classification context. |
String
|
getWidgetVersion()
Returns a custom version string for the widget type. |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel parcel, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
|---|---|
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(Parcel,int),
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR bit.
int0 or
public String getPackageName ()
Returns the package name of the app that this context originated in.
| Returns | |
|---|---|
String |
This value cannot be null. |
public String getWidgetType ()
Returns the widget type for this classification context.
Stringnull.
TextClassifier.WIDGET_TYPE_TEXTVIEWTextClassifier.WIDGET_TYPE_EDITTEXTTextClassifier.WIDGET_TYPE_UNSELECTABLE_TEXTVIEWTextClassifier.WIDGET_TYPE_WEBVIEWTextClassifier.WIDGET_TYPE_EDIT_WEBVIEWTextClassifier.WIDGET_TYPE_CUSTOM_TEXTVIEWTextClassifier.WIDGET_TYPE_CUSTOM_EDITTEXTTextClassifier.WIDGET_TYPE_CUSTOM_UNSELECTABLE_TEXTVIEWTextClassifier.WIDGET_TYPE_NOTIFICATIONTextClassifier.WIDGET_TYPE_CLIPBOARDTextClassifier.WIDGET_TYPE_UNKNOWNpublic String getWidgetVersion ()
Returns a custom version string for the widget type.
| Returns | |
|---|---|
String |
This value may be null. |
See also:
public String toString ()
Returns a string representation of the object.
| Returns | |
|---|---|
String |
a string representation of the object. |
public void writeToParcel (Parcel parcel,
int flags)Flatten this object in to a Parcel.
parcelParcel: The Parcel in which the object should be written.
null.flagsint: Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
0 or a combination of the following:
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-02-26 UTC.