Simple links in android
There are few things that give a developer more pleasure than finding those small functions and helpful methods that can save huge amounts of work in development. When developing Android apps, one of my very favourite is the Linkify, a small, powerful and configurable utility that automatically adds links to any block of text that you're displaying in your Activity's views.
The simplest way to use Linkify is just to use the following function:
This will scan through the content of the TextView, and add links with correct intents for any web pages, email addresses, phone numbers or map references: most of the time; that's all that your project will need. However, Linkify also provides a simple framework for adding our own regular expressions to match against the text content and assign these to URLs of our choice. For instance, I could check for a number of keywords and link them to some description page within the app itself. This is particularly useful if I don't have complete control of the source data.