开发者

Text for links android

开发者 https://www.devze.com 2023-03-06 07:49 出处:网络
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>.

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

精彩评论

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