Added in API level 1

SpanWatcher

interface SpanWatcher : NoCopySpan
android.text.SpanWatcher

When an object of this type is attached to a Spannable, its methods will be called to notify it that other markup objects have been added, changed, or removed.

Summary

Public methods
abstract Unit
onSpanAdded(text: Spannable!, what: Any!, start: Int, end: Int)

This method is called to notify you that the specified object has been attached to the specified range of the text.

abstract Unit
onSpanChanged(text: Spannable!, what: Any!, ostart: Int, oend: Int, nstart: Int, nend: Int)

This method is called to notify you that the specified object has been relocated from the range ostart…oend to the new range nstart…nend of the text.

abstract Unit
onSpanRemoved(text: Spannable!, what: Any!, start: Int, end: Int)

This method is called to notify you that the specified object has been detached from the specified range of the text.

Public methods

onSpanAdded

Added in API level 1
abstract fun onSpanAdded(
    text: Spannable!,
    what: Any!,
    start: Int,
    end: Int
): Unit

This method is called to notify you that the specified object has been attached to the specified range of the text.

onSpanChanged

Added in API level 1
abstract fun onSpanChanged(
    text: Spannable!,
    what: Any!,
    ostart: Int,
    oend: Int,
    nstart: Int,
    nend: Int
): Unit

This method is called to notify you that the specified object has been relocated from the range ostart…oend to the new range nstart…nend of the text.

onSpanRemoved

Added in API level 1
abstract fun onSpanRemoved(
    text: Spannable!,
    what: Any!,
    start: Int,
    end: Int
): Unit

This method is called to notify you that the specified object has been detached from the specified range of the text.