michael
michael

Reputation: 110570

How to render text in TextView which has URL apparence

Can you please if how can I render text TextView with URL like appearance (blue text with an underline)? And it can mixed with regular text (display as plain text)? And when I click on it, it will launch WebView loading that URL?

Upvotes: 2

Views: 495

Answers (2)

j7nn7k
j7nn7k

Reputation: 18582

You could also create a button, image button, etc. and run a method kinda like this on press:

private void openLink(){

Intent i = new Intent(Intent.ACTION_VIEW); 
supportIntent.setData(Uri.parse("http://www.example.tld/"));    
this.startActivity(i);  }

But Karan's solutions is probably more straight forward for your purpose.

Cheers Johe

Upvotes: 0

Karan
Karan

Reputation: 12782

Check autoLink parameter of TextView.

Upvotes: 3

Related Questions