I want to set an automatic thousand separator to my edittext. I did it with an textwatcher. In
public void afterTextChanged(Editable s)
i save the current value of my edittext, format it with
@Override
public void afterTextChanged(Editable s) {
InputField.this.removeTextChangedListener(this);
double tmp = getDoubleValue();
s.clear();
s.append(DecimalFormat.getInstance(Locale.GERMAN).format(tmp));
InputField.this.addTextChangedListener(this);
}
});
But the Keyboard from my Galaxy Tab doesn't care If I clear the editable. It keeps the current input and fills the edittext with the complete number. A short example:
I type "1", the keyboard inserts "1", the edittext shows "1".
I type "2", the keyboard inserts "12", the edittext shows "112"
I type "3", the keyboard inserts "123", the edittext shows "112.123"
I press the delete button, the keyboard inserts "12", the edittext shows "11.212.312"
I press the delete button again, the keyboard inserts "1", the edittext shows "112.123.121"
My question is:
how can I disable this keyboardfeature?
or how can I clean this keyboard "cache"?
If I use inputtype "numberDecimal", it works but I can't use points as thousand separators(but it is needed in germany), because they will be interpreted as decimal mark and there can only be one.