I am trying to add a link to a website within the text of my TextView.
I'm using Html.fromHtml() method to set the text, and the link is looking as expected, but when I click it, it's not doing anything. I tried setting movementMethod to LinkMovementMethod.getInstance(), but this just gets rid of my formatting, still not working.
agreementText.text = HtmlCompat.fromHtml("I'm familiar with <a href=\"https://www.sololearn.com/terms-of-use\">terms of use</a> of this website.", HtmlCompat.FROM_HTML_MODE_LEGACY)
agreementText.movementMethod = LinkMovementMethod.getInstance()
My TextView:
<TextView
android:id="@+id/agreement_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:linksClickable="true"
android:autoLink="all"/>