how to make anchor tag in android clickable

前端 未结 2 866
执笔经年
执笔经年 2021-01-06 17:14

this is my code :

TextView aboutL1 = (TextView) findViewById(R.id.aboutL2);
    aboutL1.setText(Html.fromHtml(\"This app is open source.
The source
2条回答
  •  青春惊慌失措
    2021-01-06 17:47

    You need to call setMovementMethod:

    aboutL1.setMovementMethod(LinkMovementMethod.getInstance());
    

    (you may not even need to call Linkify.addLinks since you used Html.fromHtml, but I can't totally remember).

提交回复
热议问题