I have an EditText and I need to highlight some text i.e. change the color of pieces of text. I am using SpannableStringBuilder with ForegroundColorSpan to set text color. The problem is (on some devices, for example Lenovo s90) if I have some text highlighted and user press space on soft keyboard,the space does not appear in EditText.
Asked
Active
Viewed 82 times
0
-
Add your code an expected output . – ADM Jan 11 '18 at 05:48
-
@Aleksandr did you try for TextWatcher ? – coder_baba Jan 11 '18 at 05:49
-
problem is that after textcolor was set, user cannot type space symbol – Aleksandr Jan 11 '18 at 05:50
-
solved. my fault was I set text to EditText every time when modified instead of simply editing existing *editable* from EditText. – Aleksandr Jan 14 '18 at 09:08