2012-02-17 10 views
1

ウェブページへのリンクを含むテキストを作成する必要があります。私は、そのコードを使用しますが、動作していない:リンク先のリンクからのクリック可能なリンク

licence = (TextView)findViewById(R.id.about_text5); 
final SpannableString s = new SpannableString(Html.fromHtml("The ipiit Team\n\nFYI:  This software contains the <a href=\"http://code.google.com/p/zxing\">zxing</a> component licensed under <a href=\"http://httpd.apache.org/docs/2.0/license.html\">Apache 2.0</a>.\n\n")); 
Linkify.addLinks(s, Linkify.WEB_URLS); 
licence.setText(s); 
licence.setMovementMethod(LinkMovementMethod.getInstance()); 

答えて

2

私はそれがあるべきだと思う...

Linkify.addLinks(licence , Linkify.WEB_URLS); 

なく

Linkify.addLinks(s, Linkify.WEB_URLS); 

すでにあなたにあなたのSpannableテキストを設定しているので、 TextViewにあるので、TextViewのaddLinkを呼び出してください...

関連する問題