Posted on

InputFilter

{
  final InputFilter filter = new InputFilter() { 
        @Override
        public CharSequence filter(CharSequence source,
                int start, int end, Spanned dest, int dstart,
                int dend)
        {
              for (int i = start; i < end; i++)
              { 
                   if (Character.isDigit(source.charAt(i))||Character.isLetter(source.charAt(i)))
                   { 
                           return ""; 
                   } 
           } 
            return null;
        } 
};
answerTXT.setFilters(new InputFilter[]{filter});
Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.