TextView.KeyListener Property

Definition

Gets the current KeyListener for the TextView. -or- Sets the key listener to be used with this TextView.

public Android.Text.Method.IKeyListener? KeyListener { [Android.Runtime.Register("getKeyListener", "()Landroid/text/method/KeyListener;", "")] get; [Android.Runtime.Register("setKeyListener", "(Landroid/text/method/KeyListener;)V", "GetSetKeyListener_Landroid_text_method_KeyListener_Handler")] set; }
[<get: Android.Runtime.Register("getKeyListener", "()Landroid/text/method/KeyListener;", "")>]
[<set: Android.Runtime.Register("setKeyListener", "(Landroid/text/method/KeyListener;)V", "GetSetKeyListener_Landroid_text_method_KeyListener_Handler")>]
member this.KeyListener : Android.Text.Method.IKeyListener with get, set

Property Value

the current key listener for this TextView.

Attributes

Remarks

Property getter documentation:

Gets the current KeyListener for the TextView. This will frequently be null for non-EditText TextViews.

Java documentation for android.widget.TextView.getKeyListener().

Property setter documentation:

Sets the key listener to be used with this TextView. This can be null to disallow user input. Note that this method has significant and subtle interactions with soft keyboards and other input method: see KeyListener#getInputType() KeyListener.getInputType() for important details. Calling this method will replace the current content type of the text view with the content type returned by the key listener.

Be warned that if you want a TextView with a key listener or movement method not to be focusable, or if you want a TextView without a key listener or movement method to be focusable, you must call #setFocusable again after calling this to get the focusability back the way you want it.

Java documentation for android.widget.TextView.setKeyListener(android.text.method.KeyListener).

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