Using Linkify in ListView's ArrayAdapter causes RuntimeException

前端 未结 3 1372
说谎
说谎 2021-01-16 09:18

I have a TextView in my ArrayAdapter that may contain some hyperlinks. For those links I use Linkify:

public View get         


        
3条回答
  •  粉色の甜心
    2021-01-16 09:52

    If you are interested to open a link, you can use

    String text = "Google";
    holder.content.setText(Html.fromHtml(text));
    holder.content.setMovementMethod(LinkMovementMethod.getInstance());
    

    this would would work fine for you inside a ListView.

提交回复
热议问题