private SpannableStringBuilder dealWeiboContent(String weiboContent,
TextView textView) {
Pattern pattern = Pattern
.compile("((http://|https://){1}[\\w\\.\\-/:]+)|(#(.+?)#)|(@[\\u4e00-\\u9fa5\\w\\-]+)");
temp = weiboContent;
Matcher matcher = pattern.matcher(temp);
List<String> list = new LinkedList<String>();
while (matcher.find()) {
if (!list.contains(matcher.group())) {
temp = temp.replace(
matcher.group(),
"<a href=\"" + matcher.group() + "\">"
+ matcher.group() + "</a>");
/*temp = temp.replace(
matcher.group(),
"<font color='#365C7C'><a href=
Android学习—— TextView ClickableSpan 点击链接事件 改超链接颜色
最新推荐文章于 2024-01-03 14:35:21 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)