>
> I would like to create a TextView that would contain a single link,
> e.g. google.com. After click it would open google.com in browser.
> I found a way how to do it, but it's a bit slow, can this be done more
> efficiently? Now I use this code:
>
> TextView link = (TextView) findViewById(R.id.link);
> link.setText(Html.fromHtml("<a href=\"http://www.google.com\";>google</
> a>"));
> link.setMovementMethod(LinkMovementMethod.getInstance());

You can try Linkify:

http://developer.android.com/reference/android/text/util/Linkify.html

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to