2011-09-26 15 views

risposta

15

Semplice. Basta inserire il link nel tuo TextView.

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

Nota: La proprietà più importante qui è android:autoLink="all". Questo ti consente di collegarti a url, email e numeri di telefono.

Nella tua strings.xml aggiungere il link:

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

So che questa risposta è in arrivo molto tardi, ma spero che aiuta a qualcun altro venendo.

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

Neanche vicino a ciò che è stato chiesto in questione –