Skip to content Skip to sidebar Skip to footer

My Custom Edittext Not Working Correctly

I am working on a EditText which can take Bold, Italics and Underline characters as mentioned in this question. I have extended EditText and overrided the onTextChanged() method. M

Solution 1:

Your problem is that you are re-using instances of the spans. Per the documentation of setSpan (emphasis mine):

Attach the specified markup object to the range start…end of the text, or move the object to that range if it was already attached elsewhere.

So you simply need to create new Spans each time you want to attribute text.

Hope that helps!

Post a Comment for "My Custom Edittext Not Working Correctly"