我使用了这个链接Android中找到的方法:Linkify TextView
public static void addLink(TextView textView, String patternToMatch,
final String link) {
Linkify.TransformFilter filter = new Linkify.TransformFilter() {
@Override public String transformUrl(Matcher match, String url) {
return link;
}
};
Linkify.addLinks(textView, Pattern.compile(patternToMatch), null, null,
filter);
}
我的函数调用
addLink(text, "Forgot password?", "http://www.abc.com");
但结果是“忘记密码?” 粗体部分为蓝色并带有下划线。我如何包含“?” 也变成蓝色和下划线?谢谢。