android:autoLink - Have Clickable Web URL Link in TextView, in XML

How to Have Clickable Web URL Link in a TextView, in XML

android:autoLink was added in API Level 1

1. Create an Android project, if you don't already have one.

2. Add a TextView.

3. In the main.xml file, add the below lines (the android:text change is for testing purposes only) 

  <TextView
    ....
      android:text="http://www.google.com"
      android:autoLink = "web"
  />
 
4. Compile and run!

5. Click on the TextView and the link should open your default internet browser. 

Related Articles:


Resources:
http://developer.android.com/reference/android/widget/TextView.html#attr_android:autoLink