Reputation: 2342
I'm creating a text editor, and i wont to able users to select some words in EditText and change color of the selected words, How can I do that? Or how can i understand which words, user selected? Thanks
Upvotes: 0
Views: 175
Reputation: 2319
Use getSelectionStart and getSelectionEnd to get the active selection.
Use SpannableString and SpannableString.setSpan to colorize the selection using a ForegroundColorSpan.
Upvotes: 4