-1

リソースのstrings.xmlから文字列を取得し、その文字列をTextViewに入れます。

strings.xml 内:

<string name="description">Hello please look into <a href="http://www.webtour.dk">www.webtour.dk</a></string>

main.xml で:

<TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/description"
                android:textSize="12dp"
                android:textStyle="bold" />

この結果は良い結果になりました。www.webtour.dk がリンクとして表示されます。しかし、リンクをクリックしても何も得られません!!! ナビゲーターが起動しない??

4

1 に答える 1

2

Linkifyを使用するだけで、Web サイトを自動的に検索できます。

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:autoLink="web"
    android:text="@string/description"
    android:textSize="12dp"
    android:textStyle="bold" />

次に、テキストから html を取り出します。

<string name="description">Hello please look into www.webtour.dk</string>
于 2012-06-30T23:10:16.977 に答える