Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I couldn't figure it out, but finally it started working when I did something like:</p> <pre><code>tvTermsOfUse.setText(Html.fromHtml(getString(R.string.tv_terms_of_use_html))); Linkify.addLinks(tvTermsOfUse, Linkify.ALL); tvTermsOfUse.setMovementMethod(LinkMovementMethod.getInstance()); </code></pre> <p>Text view looks like:</p> <pre><code>&lt;TextView android:id="@+id/tv_terms_of_use" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:textAlignment="gravity" android:gravity="center" android:textColor="@android:color/white" android:textSize="15sp" /&gt; </code></pre> <p>and string res:</p> <pre><code>&lt;string name="tv_terms_of_use_html"&gt; &lt;![CDATA[This is link to &lt;a href="http://google.com/"&gt;Google&lt;/a&gt;.]]&gt; &lt;/string&gt; </code></pre> <p><strong>Important part:</strong> The <code>Linkify.addLinks</code> has to be done <strong>before</strong> <code>tvTermsOfUse.setMovementMethod</code>, otherwise it won't work. </p> <p>No other settings are necessary in XML.</p> <p>It took me around hour to figure it out myself, hope it helps someone.</p> <p><strong>EDIT:</strong></p> <p>According to @rfellons comment</p> <blockquote> <p>Thanks. Also for me works ... BUT only with </p> <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt; </code></pre> <p>on Manifest.xml. – rfellons Sep 7 at 13:31</p> </blockquote> <p>Make sure you check it as well.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload