Skip to main content
Active reading.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

byBy using linkify:   

Linkify taketakes a piece of text and a regular expression and turns all of the regex matches in the text into clickable links:

TextView textView = (TextView) findViewById(R.id.textView); textView.setText("http://www.domainexample.com"); Linkify.addLinks(textView, Linkify.WEB_URLS); 

Don't forget to

import android.widget.TextView; 

by using linkify:  Linkify take a piece of text and a regular expression and turns all of the regex matches in the text into clickable links

TextView textView = (TextView) findViewById(R.id.textView); textView.setText("http://www.domain.com"); Linkify.addLinks(textView, Linkify.WEB_URLS); 

Don't forget to

import android.widget.TextView; 

By using linkify: 

Linkify takes a piece of text and a regular expression and turns all of the regex matches in the text into clickable links:

TextView textView = (TextView) findViewById(R.id.textView); textView.setText("http://example.com"); Linkify.addLinks(textView, Linkify.WEB_URLS); 

Don't forget to

import android.widget.TextView; 
Source Link
DeathRs
  • 1.1k
  • 17
  • 23

by using linkify: Linkify take a piece of text and a regular expression and turns all of the regex matches in the text into clickable links

TextView textView = (TextView) findViewById(R.id.textView); textView.setText("http://www.domain.com"); Linkify.addLinks(textView, Linkify.WEB_URLS); 

Don't forget to

import android.widget.TextView;