How can I do that if the user is not typing A
, then there will not be any output? I want to do this in a EditText
.
Code:
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.toString(source.charAt(i)).equals("a")) {
return "";
}
}
return null;
}
};