Android EditText: how to apply spans when composing?
问题 How can I apply spans on EditText text when the user is composing? For example the user has activated "bold" when composing, so every character input since then should be bold . I thought about adding text change listener to the EditText and update the text as the user composes, but I wanna know if there's a better way of doing this. 回答1: The question was already answered in the comments, but to make it more permanent I will add a fuller answer. In order to set a span (like Bold) wherever the