我想给一个链接,所有twitter @提及的mytweets应用程序在安卓。如果我点击@提及,我想打开另一个关于@提及的页面。
此代码不起作用。首先,我想搜索推文中的@提及,我给出了这个@提及的链接,如果我在推特中点击这个@提及,我想打开另一个关于这个@提及的页面。
TextView bt = (TextView) v.findViewById(R.id.bottomtext);
Pattern atMentionPattern = Pattern.compile("@([A-Za-z0-9_]+)");
String atMentionScheme = "http://twitter.com/";
TransformFilter transformFilter = new TransformFilter() {
public String transformUrl(final Matcher match, String url) {
return match.group(1);
}
};
Linkify.addLinks(bt, Linkify.ALL);
Linkify.addLinks(bt, atMentionPattern, atMentionScheme, null, transformFilter);发布于 2013-02-14 18:30:19
试着这样做
textView.setAutoLinkMask(0);
// Recognize phone numbers and web URLs
Linkify.addLinks(text, Linkify.PHONE_NUMBERS | Linkify.WEB_URLS);
// Recognize all of the default link text patterns
Linkify.addLinks(text, Linkify.ALL);
// Disable all default link detection
Linkify.addLinks(text, 0);请参阅此处的文档
http://polamreddyn.blogspot.in/2013/01/android-text-links-using-linkify.html
https://stackoverflow.com/questions/14872611
复制相似问题