Everytime Edittext onAfterTextChange method, I check if some special string is entered (which comes from the functionlist variable), and then change this special color. Code below
for(String s:functionList) { final Pattern p = Pattern.compile(s); final Matcher matcher = p.matcher(inputStr); while(matcher.find()) {
The reason I am not using the Html.FromHtml method; this forces me to use the setText method, which changes the cursor position, and since my edittext is also changed from buttons (call settext buttons) not only to softkeyboard, this settext method destroys the cursor position, since the button changes the cursor position to 0 EVEN IS NOT !! !! so I cannot add something in the middle using softkeyboard (when I try to add, the cursor position is always set to 0). That is why I have to use spannable.
In any case, my problem is that one of my special texts is the "magazine". When I enter the log, it works fine ( log ), when a log with a space character is added ( log log ), it works fine again , but WHEN I DELETE G from the second log, the first color of the log also disappeared !!! (log lo), which should not happen. Think bold journal as it is colored ...
Why is this happening?
source share