1

There appears to be 2 problems I am facing when we manually set the Edit Text.

  1. The cursor is reset to the first position. (Which could be resolved by getting the cursor position and setting it after updating text)
  2. The suggestions (candidates) list above the keyboard will get cancelled. (For eg. If you have been typing sugg [suggest, suggestion] will appear, and just when we set text/ or update with new color span, the suggestions will get cleared) Also in case of language keyboard change (for eg. Japanese keyboard), the set Text will reset back to english keyboard.

Is there any workaround for the above given problems, especially problem 2 ?

Monster Brain
  • 1,950
  • 18
  • 28

1 Answers1

0

Try to use it like this

myEditText.getText().clear();
myEditText.append(newTextString);
Usama Altaf
  • 90
  • 1
  • 4
  • 23