I am developing an application for keyboard, but i am geting an issue. I want to restrict/block some special character from soft keyboard in EditText in android programmatically.
So, Is there any way i can restrict any special character input in edit text in android.
If anyone have idea,Please reply.
Thanks in advance.
you can prevent for typing special character:
Try this may works for you
This should work:
Or if you prefer the easy way:
Its late but may be helpfull for others. Instead of programaticaly, you can go with xml attribute. It may be the case that in Single layout you have many editText, out of which you wanna restrict special characters only in one EditText. So defining in xml will help you out. Here is the code to restrict special Characters by allowing them to only enter alphabets and numbers like below