Search code examples
androidandroid-edittextkeypad

How to exclude special characters from android keypad for EditText


Hi I want to show only numbers and characters on the keypad for EditText in android, I did try to add the attribute android:inputType = text|number but it did not work.

Please help me with any other better suggestion. thanks in advance.


Solution

  • try to add the digits parameter to your editText:

    android:digits="abcde.....012345789"