TextClassifierEvent.TextLinkifyEvent


public static final class TextClassifierEvent.TextLinkifyEvent
extends TextClassifierEvent implements Parcelable

java.lang.Object
   ↳ 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

class TextClassifierEvent.TextLinkifyEvent.Builder

Builder class for TextLinkifyEvent

Inherited constants

Fields

public static final Creator<TextClassifierEvent.TextLinkifyEvent> CREATOR

Inherited fields

Inherited methods

Fields

CREATOR

Added in API level 29
public static final Creator<TextClassifierEvent.TextLinkifyEvent> CREATOR