0

I'm using Textview to show text with URLs inside. How to linkfy part of text? This tag doesn't work:

<a href=\"http://www.mycite.com/terms/android\"><big>current terms</big></a>
Kostadin
  • 2,499
  • 5
  • 34
  • 58

2 Answers2

2
tv.setMovementMethod(LinkMovementMethod.getInstance());
tv.setText(Html.fromHtml(Your string));
Samir Mangroliya
  • 39,918
  • 16
  • 117
  • 134
0
TextView tv = (TextView) findViewById(R.id.text3);
    tv.setText(
        Html.fromHtml(
            "<b>text3:</b>  Text with a " +
            "<a href=\"http://www.google.com\">link</a> " +
            "created in the Java source code using HTML."));
    tv.setMovementMethod(LinkMovementMethod.getInstance());
Sunny
  • 14,522
  • 15
  • 84
  • 129