A
AC Question
I have applied InputFilter for edittext .The replaceAll("..","$0 ") should replace any two character along with digits ,but if I give only digits it is not working.
What I should get is like while typing in edit text it should append space with it
Eg:
Input : abcd12344a3b
Output: ab cd 12 34 4a 3b
inputFilter = new InputFilter(){
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
String s = source.toString()
String rep = s.replaceAll(".." , "$0 ");
return rep;
}
};
EditText.setFilters(new InputFilter[] {inputFilter});
What I should get is like while typing in edit text it should append space with it
Eg:
Input : abcd12344a3b
Output: ab cd 12 34 4a 3b
inputFilter = new InputFilter(){
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
String s = source.toString()
String rep = s.replaceAll(".." , "$0 ");
return rep;
}
};
EditText.setFilters(new InputFilter[] {inputFilter});