I have getting dynamic text from a web service and showing the same in a TextView. Sometimes the TextView has url like hello
There are 2 cases:
"click on http://www.hello.com"
then you just have to set the autoLink attribute in the xml so that the link is automatically detected in the text:
click on hello
then you have to do it by code and tell the text is html, and specify a Link movement method for the click:
String text = "click on hello";
TextView textView = view.findViewById(R.id.textView);
textView.setText(Html.fromHtml(text));
textView.setMovementMethod(LinkMovementMethod.getInstance());