I have a custom implementation of an edit text class.
Based on these XML attribute.....
android:inputType=\"textPersonName\"
android:inputType=\"text
-
How to get the InputType from an EditText
To get the input type use getInputType().
int inputTypeValue = editText.getInputType();
The InputType
values are defined (in hexadecimal) in the documentation.
You can test the values with something like
if (inputTypeValue == InputType.TYPE_CLASS_TEXT) { ... }
See also
- Setting the InputType
- 热议问题