2013-02-14 1 views
3

안드로이드에 mytweets app에 twitter @mentions를 모두 연결하고 싶습니다. @mentions를 클릭하면 @mentions에 대한 다른 페이지를 열고 싶습니다.twitter linkify 안드로이드 all @mentions

이 코드는 작동하지 않습니다. 첫째로 짹짹에서 @mentions를 검색하고 싶습니다. 그리고이 @mentions에 링크를 제공하고 짹짹에서이 @mentions를 클릭하면이 @mentions에 대한 또 다른 페이지를 열고 싶습니다.

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); 

답변

0

여기이

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); 

처럼 참조하려고 나는이 코드를 tryed 문서

http://polamreddyn.blogspot.in/2013/01/android-text-links-using-linkify.html

+0

하지만 내 응용 프로그램에서 작동하지 않습니다. – baran