Added in API level 29
TextLinkifyEvent
class TextLinkifyEvent : TextClassifierEvent, Parcelable
| kotlin.Any | ||
| ↳ | android.view.textclassifier.TextClassifierEvent | |
| ↳ | android.view.textclassifier.TextClassifierEvent.TextLinkifyEvent | |
This class represents events that are related to the smart linkify feature.
// User clicked on a link. new TextLinkifyEvent.Builder(TYPE_LINK_CLICKED) .setEventContext(classificationContext) .setResultId(textClassification.getId()) .setEntityTypes(textClassification.getEntity(0)) .setScore(textClassification.getConfidenceScore(entityType)) .setEventIndex(0) .build(); // Smart (contextual) actions presented to the user in response to a link click. new TextLinkifyEvent.Builder(TYPE_ACTIONS_SHOWN) .setEventContext(classificationContext) .setResultId(textClassification.getId()) .setEntityTypes(textClassification.getEntity(0)) .setScore(textClassification.getConfidenceScore(entityType)) .setActionIndices(range(textClassification.getActions().size())) .setEventIndex(1) .build(); // User chooses smart action at index 0. new TextLinkifyEvent.Builder(TYPE_SMART_ACTION) .setEventContext(classificationContext) .setResultId(textClassification.getId()) .setEntityTypes(textClassification.getEntity(0)) .setScore(textClassification.getConfidenceScore(entityType)) .setActionIndices(0) .setEventIndex(2) .build();
Summary
| Nested classes | |
|---|---|
|
Builder class for |
|
| Inherited constants | |
|---|---|
| Inherited functions | |
|---|---|
| Properties | |
|---|---|
| static Parcelable.Creator<TextClassifierEvent.TextLinkifyEvent!> | |
Properties
CREATOR
Added in API level 29
static val CREATOR: Parcelable.Creator<TextClassifierEvent.TextLinkifyEvent!>