views:

160

answers:

1

How to restrict the special characters in android EditText field?

+2  A: 

have you tried adding the android:digits="abcde.....012345789" attribute? although the android:digits specify that it is a numeric field it does work for me to set it to accept letters as well, and special characters as well (tested on SDK-7)

if this doesn't work then you'll have to implement KeyListener see: link text

alvin
thanks alvin its work fine
saravanan palpandi
if it works fine please mark my answer as accepted, http://meta.stackoverflow.com/questions/5234/accepting-answers-what-is-it-all-about
alvin