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,377
  • 5
  • 31
  • 58

2 Answers2

2
tv.setMovementMethod(LinkMovementMethod.getInstance());
tv.setText(Html.fromHtml(Your string));
Samir Mangroliya
  • 39,219
  • 16
  • 116
  • 133
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
  • 13,864
  • 15
  • 78
  • 126