如果用户没有输入,我该怎么做,A
那么就不会有任何输出?我想在EditText
.
代码:
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;
}
};