In Android, if I use binding, how to apply ClickableSpan?
问题 I know that if binding is not applied, then I can use Textview.setText(ClickableSpan) to apply spannig effect to make part of the text clickable. However, my app used binding and the textview's text is binded to a ViewModel inside xml like android:text="@{model.certainString}" and in the ViewModel I declared String certainString = "" , in this case how do I apply spanning inside the ViewModel then? 回答1: You could write your own BindingAdapter which accepts either the model or the string value