I am currently trying to make a Writing program. I would like the functionality of an Edit tool bar that contains things such as BOLD, ITALIC, UNDERLINE, etc. I see that it is under Typeface but I’m struggling to figure out how to make it function on just selected text or just for formatting text. I already have the GUI and button listeners in place. Thanks.
Share
There is nothing really built into Android for this, except at a fairly low level. I have the beginnings of a
RichEditTextcustom widget, as a drop-inEditTextreplacement, but it needs a fair bit of work, which I will get to later in June (I hope I hope I hope).In a nutshell, you will need to get a
Spannableobject from yourEditTextviagetText(), then call methods likesetSpan()on it to apply your formatting.