This is a continuation of our posts adding features to GitHub Contributions App. We have been developing this app on android. The app allows loading some important details from the profile of a github user including the repositories list. The information is provided by GitHub through HTTP Service.
In this small post, we will be updating the blog address to a hyperlink. You would be amazed to know that there is no separate View type in android for hyperlinks.
We add the hyperlinks using the same TextView type. We can create hyperlinks for web-links, maps, email and other types. Clicking on the hyperlink text would open the corresponding apps selection registered for this. These are the default types supported to include hyperlinks. This is similar to applications registered for particular URI scheme in microsoft’s world [See this].
We just need to update the definition of TextView with the particular type of link. Since we are interested in opening the user’s blog in a browser, we need to select web here.
Now let’s update the code and start debugging it again using the same emulator.
You can see that the blog address is updated as link. As we click the link, the browser opens up the blog.