android - How to make links in textview clickable -


how make links clickable in text view. problem

(1). view.setmovementmethod(linkmovementmethod.getinstance()); works when textview contains link(anchor tag/href) this:

<a href="http link">go google</a> 

it does'nt work when textview contains link this: http link

(2). while android:autolink="web" works when textview contains link this: http link does'nt work when textview contains link this:

<a href="httplink">go google</a> 

what when textview contains both types of link. please help.

try this

textview.setonclicklistener(new view.onclicklistener()); 

in xml:

android:clickable="true" 

or can use string

 htmltext=html.fromhtml(htmltext) 

then set htmltext textview

textview.settext(htmltext) 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -