It's the year 2022, and still this problem exists (at least on Samsung devices):)
So I solved this by adding a TextChangedListener to the EditText and check, whether the last entered character is equal to a (country specific) thousands separator. If so, I replace it by a country specific decimal separator:
public class EditTextTausenderErsetzer implements TextWatcher{
...
@Override
public void afterTextChanged(Editable editable)
{
// determine country specific separators
// char thousandsSep = .., char commaSep =..
int comma_index = editable.toString().indexOf(commaSep);
if(comma_index == -1) { // no comma so far, thus there might be a "." which shall be a comma separator
if (editable.toString().indexOf(thousandsSep) != -1) {
if (editable.toString().indexOf(thousandsSep, (editable.length()-1)) == (editable.length() - 1)) {
editable.delete(editable.length() - 1, editable.length() - 1);
editable.insert(editable.length(), commaSep + "");
}
}
}
// ...
// do other stuff like setting automatically thousands separators
This solution works, if your app manages the thousands separators, and you do not allow the user to set these.