Make Clickable Link simply with TextView

person Jason Huangfolder_openAndroidlocal_offer, , , access_time November 9, 2010

TextView is very powerful, besides being a nice text displayer, it could also set automatically to launch URL, email, phone number etc.

You simply need to use a TextView Control in Android, and set its property “Auto Link” to Web etc. For example:


This is TextView with a launchable URL text:


Another more interesting and easier approach is to use Linkify class in Android. This class can automatically read the content of TextView, and automatically create the link based on the content of the Text. For example, it will read phone number and generate a phone number link you can launch, it will read URL and generate a URL link you can run the browser on, it will also generate email link for text that looks like email.

	TextView tv = (TextView) findViewById(R.id.about_content);
	tv.setText(Html.fromHtml(AboutText));
	Linkify.addLinks(tv, Linkify.ALL);

Comments

  1. Great post! We will be linking to this great content on our website.
    Keep up the good writing.

  2. Also, they may ask you for a small fee for unlocking your phone.
    Incase you uploaded your ebooks to the storage provider’s server , you’ll be able to read your ebooks directly from your mobile
    device by login into your control panel from your mobile device and
    selecting the book that you want to read. We all know that numbers are complicated and people can easily
    make mistakes with them, so why not make your lives
    easier by simply availing the accounting software
    that will assist in all your accounting matters.

  3. hello there and thank you for your information – I’ve definitely picked
    up anything new from right here. I did however expertise
    a few technical points using this website, since I experienced to
    reload the site a lot of times previous to I could get it to load correctly.
    I had been wondering if your web host is OK? Not that I
    am complaining, but sluggish loading instances times will sometimes affect your placement in google
    and could damage your high quality score if advertising and marketing with Adwords.
    Anyway I’m adding this RSS to my email and can look out for a lot more of
    your respective intriguing content. Ensure that you update this again very soon.

  4. I think this is one of the most vital info for me.
    And i’m satisfied studying your article. However should observation on few normal issues, The web site style is great, the articles is truly excellent : D.
    Good task, cheers

  5. Nice blog! Is your theme custom made orr did you download it from somewhere?
    A theme like yours with a few simple tweeks would really make my blog stand out.
    Please let me knlw where you got your design. Bless you

  6. Hi to every , since I am actually eager of reading
    this webpage’s post to be updated regularly.
    It consists of pleasant material.

  7. Good site you have here.. It’s hard to find quality writing like yours these days.
    I honestly appreciate people like you! Take care!!

  8. What’s up, after reading this amazing article i am ass
    well glad to share my know-how here with colleagues.

  9. If you want to grow your know-how simply keep visiting this web page and be updated
    with the latest gossip posted here.

  10. Asking questions are actually pleasant thing if you are not understanding
    something totally, except this paragraph provides good understanding yet.

  11. My spouse and I absolutely love your blog and find almost all of your post’s
    to be just what I’m looking for. Does one offer guest writers to write content
    in your case? I wouldn’t mind composing a post or elaborating on a few of the subjects
    you write in relation to here. Again, awesome website!

  12. Just want to say your article is as astounding. The clarity in your put up is
    simply spectacular and that i could suppose you are an expert
    on this subject. Fine with your permission let me to take hold of your RSS feed to stay
    up to date with impending post. Thanks a million and please carry on the enjoyable work.

  13. Hi to every single one, it’s actually a good for me to
    pay a visit this web page, it includes important Information.

  14. I’ve been exploring for a little for any high quality articles or blog posts on this kind of
    space . Exploring in Yahoo I at last stumbled upon this web site.
    Studying this information So i’m happy to convey that I’ve a very good uncanny feeling I found out just what I needed.

    I such a lot without a doubt will make sure to do not disregard this website and provides it a
    glance on a constant basis.

  15. Datchworth Kate

    Wow! At last I got a blog fom where I be able too genuinely obtain helpful
    data regardin my study and knowledge.

  16. I like the helpful information you provide to your articles.
    I’ll bookmark your weblog and test once more right here frequently.
    I’m fairly certain I will be informed a lot of new stuff right right here!

    Good luck for the following!

    my blog: triche clash of clans (Kelley)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>