How make weblink(hyperlink) in textview in android

Weblink or Hyperlink in textview, simple way to make it:

Textview tv_link= (Textview)findViewById(R.id.tvLink);
tv_link.setText("prandroid@gmail.com");
Linkify.addLinks(tv_link, Linkify.ALL);

or may be use this also:

TextView tvLinkTest= (TextView) findViewById(R.id.tl);
tvLinkTest.setMovementMethod(LinkMovementMethod.getInstance());

next alternative method is:

<TextView
android:text="www.hello.com"
android:id="@+id/TextView01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:autoLink="web">
</TextView>

Happy Coding!!!

How make weblink(hyperlink) in textview in android How make weblink(hyperlink) in textview in android Reviewed by D Kshetri on 12:26 PM Rating: 5

No comments:

Powered by Blogger.