Clicking an URL into a TextView

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Clicking an URL into a TextView

Postby erbedo » Wed Jun 04, 2008 9:43 am

I have a textview where i display an EULA URL. The user must be able to click this link to display the EULA if he/she wants. How can I do that? I simply put the URL into the TextView but after that it is not clickable..

Thank you
Proudly supporting Android :)
Junior Developer
Junior Developer
Posts: 22
Joined: Thu Mar 13, 2008 9:39 pm


Postby plusminus » Sat Jun 07, 2008 10:29 am

Hello eurobo,

use the following piece of code to linkify emails, phonenumbers or URLs in a TextView:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. android.text.util.Linkify.addLinks(myTextView, mask);
  3. // mask can be 'ALL' or 'EMAIL_ADDRESSES' or 'PHONE_NUMBERS' or 'WEB_URLS'
Parsed in 0.012 seconds, using GeSHi

More info can be found here: ... nkify.html

Image | Android Development Community / Tutorials
User avatar
Site Admin
Site Admin
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests