There is a spannable text input field. For it is necessary to change part of the text. I do this:
{ Editable editable = getText(); editable.replace(start, end, ""); } As a result, the text is deleted, but when you enter any character, the text returns to the very end of the input field.
I tried to add TextWatcher, in the end:
@Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { //Тут текст корректный, с удаленными символами } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { //А тут уже текст некорректный. Вырезанная строка добавляется в конец } @Override public void afterTextChanged(Editable s) { //Так же как в onTextChanged } It does not appear everywhere, while it is noticed only on Samsung tablets with Android 4.1.2. Why is this happening and what to do?