例如
TextView tv =(TextView)this.findViewById(R.id.tv);
tv.setAutoLinkMask(Linkify.ALL);
tv.setText("visit website, http://www.google.com");
按下 http://www.google.com会带我去http://www.google.com . 我想做的事情是这样的
TextView tv =(TextView)this.findViewById(R.id.tv);
tv.setAutoLinkMask(Linkify.ALL);
tv.setText("visit this website");
然后按“这个”我想带我去http://www.google.com .
我该怎么做? (有可能吗?)
最佳答案
来自 API 演示,
TextView t3 = (TextView) findViewById(R.id.text3);
t3.setText(Html.fromHtml(
"<b>text3:</b> Text with a " +
"<a href=\"http://www.google.com\">link</a> " +
"created in the Java source code using HTML."));
t3.setMovementMethod(LinkMovementMethod.getInstance());
关于android - 自动链接属性与实际链接不同的文本(setAutoLinkMask),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7951752/