Android TextUtil.concat不保留超链接

Android TextUtil.concat不保留超链接,android,Android,例如,下面的代码可以正常工作 CharSequence text = TextUtils.concat( "before ", Html.fromHtml( "<b>This works</b>"), " after " ); myTextView.setText(text, TextView.BufferType.SPANNABLE ); CharSequence text=TextUtils.concat(“before”,Html.fromHtml(“This w

例如,下面的代码可以正常工作

CharSequence text = TextUtils.concat( "before ", Html.fromHtml( "<b>This works</b>"), " after " );
myTextView.setText(text, TextView.BufferType.SPANNABLE );
CharSequence text=TextUtils.concat(“before”,Html.fromHtml(“This works”),“after”);
myTextView.setText(text,TextView.BufferType.SPANNABLE);
如果我在html代码中添加超链接,即

CharSequence text = TextUtils.concat( "before ", Html.fromHtml( "<a href=\"www.google.it\">Google</a>"), " after " );
myTextView.setText(text, TextView.BufferType.SPANNABLE );
Linkify.addLinks( myTextView, Linkify.ALL );
CharSequence text=TextUtils.concat(“之前”,Html.fromHtml(“之后”);
myTextView.setText(text,TextView.BufferType.SPANNABLE);
Linkify.addLinks(myTextView,Linkify.ALL);

显示“Google”,但超链接未正确取消排列,无法单击。有什么建议吗?

删除行
Linkify.addLinks(myTextView,Linkify.ALL)
并在
文本
setText
声明之间放置以下行:


classNameTextView.setMovementMethod(LinkMovementMethod.getInstance())

成功放置classNameTextView.setMovementMethod(LinkMovementMethod.getInstance());在setText之后:)谢谢:)