开发者

Text for links android

Hello I would like to have a link to a website but with a different text on the link like a html anchor tag <a href="google.com">Alternative text</a>.

Can anyone sho开发者_JAVA技巧w any example on this? I have tried Linkify without success.


Try this:

mTextField1.setText(spanned);
mTextField1.setMovementMethod(LinkMovementMethod.getInstance());

here mTextField1 is a TextView object and spanned is a Spanned object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜