android:autoLink - Have a Clickable Street Address link in a TextView, in XML

How to Have Clickable Street Address in a TextView, 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="1600 Amphitheatre Parkway Mountain View, CA 94043"
      android:autoLink = "map"
  />
 
4. Compile and run!

5. Click on the TextView and the link should open the Google Maps app with your address 

6. Note: If your address is not typed properly, it will not display as a clickable link in the TextView.

Related Articles:

Resources: