I am a beginner in android and I would like to disable white spaces in edittext using inputfilter.
How can I do that?
I found this code in the net:
InputFilter filter = new InputFilter() {
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
for (int i = start; i < end; i++) {
if (!Character.isLetterOrDigit(source.charAt(i))) {
return "";
}
}
return null;
}
};
but it allows only letters and digits.
Thank you