Wednesday, 26 August 2015

android editText allow only alpha-numeric characters in Android

First there is no solution to show a alpha-numeric keyboard, there is no such keyboard.

for keyboard information:

But you can limited user's input for alpha-numeric only ("*-"will still clickable on the keyboard, but the input box doesn't accept it.)

In the XML, put this:
android:digits="abcdefghijklmnopqrstuvwxyz1234567890 "

For a simple input box (just one line, e.g. username), you must have this in your xml:
otherwise it will not show "done" key in your keyboard.

No comments:

Post a comment