How to make links in a TextView clickable?

后端 未结 30 3808

I have the following TextView defined:



        
30条回答
  •  野的像风
    2020-11-21 23:43

    I hope this will help you;

    String value = "Visit my blog mysite View myactivity callback";
        TextView text = (TextView) findViewById(R.id.text);
    
    
        text.setText(Html.fromHtml(value));
        text.setMovementMethod(LinkMovementMethod.getInstance());
    

提交回复
热议问题