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

Builder

class Builder
kotlin.Any
   ↳ androidx.textclassifier.TextLinks.Builder

A builder to construct a TextLinks instance.

Summary

Public constructors

<init>(@NonNull fullText: CharSequence)

Create a new TextLinks.

Public methods

TextLinks.Builder
addLink(start: Int, end: Int, @NonNull entityScores: MutableMap<String!, Float!>)

Adds a TextLink.

TextLinks

Constructs a TextLinks instance.

TextLinks.Builder

Removes all TextLinks.

TextLinks.Builder
setExtras(@Nullable extras: Bundle?)

Sets the extended, vendor specific data.

Public constructors

<init>

Builder(@NonNull fullText: CharSequence)

Create a new TextLinks.Builder.

Parameters
fullText CharSequence: The full text to annotate with links.

Public methods

addLink

@NonNull fun addLink(start: Int, end: Int, @NonNull entityScores: MutableMap<String!, Float!>): TextLinks.Builder

Adds a TextLink.

Return
TextLinks.Builder: this instance.
Exceptions
IllegalArgumentException if entityScores is null or empty.

build

@NonNull fun build(): TextLinks

Constructs a TextLinks instance.

Return
TextLinks: the constructed TextLinks.

clearTextLinks

@NonNull fun clearTextLinks(): TextLinks.Builder

Removes all TextLinks.

setExtras

@NonNull fun setExtras(@Nullable extras: Bundle?): TextLinks.Builder

Sets the extended, vendor specific data.