android - Clickable item with clickable urls in ListView -
i have custom listview item imageview , textview. textview contains html string urls , regular text. im adapter have code similar
tv.settext(html.fromhtml("<a href='http://google.com'>google</a>")); tv.setmovementmethod(linkmovementmethod.getinstance());
and works great onlistitemclick
isn't executed when click on item outside url, whole item looks inactive.
when click on url want fire default action form urls , when click on regular text or on imageview want execute onlistitemclick
possible?
second question, possible start activity using <a href="...">start activity</a>
?
you can't make intent form anchor.
it's ok , recommended use onlistitemclick
(it saves lot of work), , if want open link in browser (without using webview
) can use intent, example:
intent myintent = new intent(intent.action_view,contenturi.create("http://www.google.com")); startactivity(myintent);
hope helps.
Comments
Post a Comment