How can I use the edittext listener to prevent the user from entering special characters (&%+?@…etc) and also prevent the user from entering numbers, finally allow user to enter only letters (A B C …)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check out
EditText.setFilters(). This allows you to specify one or more instances ofInputFilterfor anEditText. These filter certain characters from the input, as the name suggest. There are a lot of prebuild ones (see “know subclasses” at the top of the class documentation), but you may also implement your own by extending theInputFilterclass.