I am developing an app like Notepad in which I want to change the selected text formatting dynamically (colors, changing font styles, bold, italic, underline etc.)
How can I format a specific word?
I am developing an app like Notepad in which I want to change the
Share
You can get the selected word using
getSelectionStart()andgetSelectionEnd()method :Then you can apply your specific formatting by using this selected substring in the full string after taking it to a SpannableStringBuilder on a button click/some other event:
Code for formatting text:
Reference.