Udostępnij za pośrednictwem


TextView.AddTextChangedListener(ITextWatcher) Method

Definition

Adds a TextWatcher to the list of those whose methods are called whenever this TextView's text changes.

[Android.Runtime.Register("addTextChangedListener", "(Landroid/text/TextWatcher;)V", "GetAddTextChangedListener_Landroid_text_TextWatcher_Handler")]
public virtual void AddTextChangedListener (Android.Text.ITextWatcher? watcher);
[<Android.Runtime.Register("addTextChangedListener", "(Landroid/text/TextWatcher;)V", "GetAddTextChangedListener_Landroid_text_TextWatcher_Handler")>]
abstract member AddTextChangedListener : Android.Text.ITextWatcher -> unit
override this.AddTextChangedListener : Android.Text.ITextWatcher -> unit

Parameters

watcher
ITextWatcher
Attributes

Remarks

Adds a TextWatcher to the list of those whose methods are called whenever this TextView's text changes.

In 1.0, the TextWatcher#afterTextChanged method was erroneously not called after #setText calls. Now, doing #setText if there are any text changed listeners forces the buffer type to Editable if it would not otherwise be and does call this method.

Java documentation for android.widget.TextView.addTextChangedListener(android.text.TextWatcher).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to