2011-09-26 9 views

答えて

15

シンプルです。 TextViewにリンクを貼るだけです。

<TextView 
    android:id="@+id/txtLink" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/about_link" 
    android:autoLink="all" /> 

注:ここで最も重要なプロパティはandroid:autoLink="all"です。これにより、あなたはURL、電子メール、電話番号にリンクすることができます。あなたのstrings.xmlで

リンクを追加:

<string name="about_link"><a href='http://example.com'>http://example.com</a></string> 
<string name="about_email"><a href='mailto:[email protected]'>[email protected]</a></string> 

を私はこの答えは本当に遅れて来ている知っているが、それは他の誰かが一緒に来て助けを願っています。

3
Uri uri = Uri.parse("http://www.example.com"); 
Intent intent = new Intent(Intent.ACTION_VIEW, uri); 
startActivity(intent); 
+0

問題の質問に近い –

関連する問題