I do spell checking, and want to show all wrong letters in red.
Like the user typed Mossosoppo and the correct word would be Missisippi. I would want to show the wrong letters in red.
I tried with SpannedString, SpannableString and SpannableStringBuilder. I also checked all examples Google would find. Nothing worked ( = maximum 1 letter was shown in red or all letters after a position).
And i tried all possible combinations of flags - SPAN_INCLUSIVE_INCLUSIVE, INCLUSIVE_EXCLUSIVE, EXCLUSIVE_INCLUSIVE, EXCLUSIVE_EXCLUSIVE.
This also didnt allow to use the same color in 2 places. The maximum i could see was a combination of different properties like color, bold, italic.
The interface to set a Span is setSpan(Object _what_, int _start_, int _end_, int _flags_).
Now this doesnt tell if it is possible to call it several times for the same property (color). Did anybody succeed to add more than 1 color span to a single string ?
If so i could digg again, maybe i had an error when i tested all possible combinations of flags. At the moment i am switching code to a LinearLayout with many TextViews where each TextView contains a single character. That should work. But it isnt elegant.