I have getting dynamic text from a web service and showing the same in a TextView. Sometimes the TextView has url like hello
hello
Check out this approach:
String text = "Visit stackoverflow.com"; TextView label = new TextView(this); label.setText(text); Pattern pattern = Pattern.compile("stackoverflow.com"); Linkify.addLinks(label, pattern, "http://");