Posted on Leave a comment

InputFilter

[code language=”java”]
{
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});
[/code]

Leave a Reply

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