Questions tagged [linkify]

An Android utility class with which you can easily link to for example webpages, phone numbers or e-mail addresses.

Linkify is a text utility class in Android with which you can easily link to for example webpages, phone numbers or email addresses.

256 questions
57
votes
17 answers

Replace URLs in text with HTML links

Here is a design though: For example is I put a link such as http://example.com in textarea. How do I get PHP to detect it’s a http:// link and then print it as print "http://www.example.com"; I remember doing…
Angel.King.47
  • 7,514
  • 14
  • 58
  • 84
33
votes
7 answers

C# code to linkify urls in a string

Does anyone have any good c# code (and regular expressions) that will parse a string and "linkify" any urls that may be in the string?
Vance Smith
  • 2,105
  • 5
  • 29
  • 32
29
votes
9 answers

Android: Linkify TextView

I have textview which I need to linkify. Here's what I am doing.. TextView text = (TextView) view.findViewById(R.id.name); text.setText("Android...Update from Android"); Pattern pattern = Pattern.compile("Android"); String scheme =…
Faheem Kalsekar
  • 1,380
  • 3
  • 23
  • 30
24
votes
3 answers

TextView that is linkified and selectable?

I would like to have a TextView that is both selectable and linkified. When I do both I end up with selectable text but links can't be clicked. EDIT: I'll show the code to explain with what I struggle: TextView textView =…
pixel
  • 21,352
  • 30
  • 113
  • 196
22
votes
11 answers

android:autoLink for phone numbers doesn't always work

I have a simple TextView with local phone number 852112222 or (8 5) 211 2222. I need it to be clickable, so naturally I used android:autoLink="all". But for some reason I don't understand same phone number is not "linkified" on all devices. On plain…
Martynas Jurkus
  • 8,758
  • 12
  • 52
  • 99
20
votes
4 answers

Android Linkify text - Spannable Text in Single Text View - As like Twitter tweet

I have a textView and text like "This is the Simple Text with KeyWord and the Link to browse" in the above text i want to make.. clicking on the Link goes to open that URL AND clicking on that KeyWord open a new Activity in my…
MKJParekh
  • 32,883
  • 11
  • 84
  • 97
18
votes
5 answers

Open TextView links at another activity, not default browser

Having the textView with autoLinkMask set to Linkify.ALL, i'm able to open the links and the browser shows the web-page. I need to call another activity that will do it with it's webView not leaving the application. Important notes: changing the…
A-Live
  • 8,858
  • 2
  • 35
  • 72
15
votes
4 answers

How can I make links in an EditText clickable?

I have an EditText on Android I'd for which I'd like any embedded urls to be clickable. I used the Linkify class, which has turned them blue and underlined them. However, I can't figure out how to actually make them clickable. Thanks!
lowellk
  • 1,979
  • 4
  • 20
  • 26
14
votes
6 answers

Android Linkify both web and @mentions all in the same TextView

Ok so I asked this yesterday: AutoLink @mentions in a twitter client I got my @mentions linking correctly. But in order to get it to work I had to take android:autoLink="web" out my xml for the TextView. So now I get links to @mentions but it no…
FoamyGuy
  • 45,328
  • 16
  • 118
  • 151
14
votes
4 answers

Android Linkify how to set custom link color?

I want to set my android linkify text color to a custom color however mText.setLinkTextColor("#2f6699"); does not work, I have been searching for a built in method that will compile a hexidecimal value but I havent found one, any help will go a long…
Edmund Rojas
  • 5,888
  • 12
  • 58
  • 88
12
votes
1 answer

Android: Start activity via link in TextView

I have a TextView which I fill with HTML and linkify it then. Some of the links in HTML are in special format and meant to be links to other activities in my project, not normal URL links. Is it possible to intercept clicks on such links in TextView…
Anton
  • 4,324
  • 7
  • 29
  • 46
12
votes
1 answer

Android set autoLink attribute programmatically

I want to create this TextView from code, however I am encountering countless problems. In the first place, I got halfway creating a TextView and adding…
mathkid91
  • 557
  • 1
  • 9
  • 22
12
votes
4 answers

convert url to links from string except if they are in an attribute of an html tag

I am trying to convert, from a textarea input ($_POST['content']), all urls to link. $content = preg_replace('!(\s|^)((https?://)+[a-z0-9_./?=&-]+)!i', ' $2 ', nl2br($_POST['content'])." "); $content =…
Toni Michel Caubet
  • 17,157
  • 49
  • 178
  • 335
11
votes
2 answers

ListView onClick event doesn't fire with Linkified email address

I have a straight forward ListView with a ListAdapter and custom onItemClick method for the list. My ListView items are clickable to perform other functions. However, some of my ListView elements contain an email address that should be clickable…
djBo
  • 930
  • 1
  • 8
  • 26
11
votes
3 answers

What is linkify's default link color?

When you do, for example, Linkify.addLinks(mTextView, Linkify.EMAIL_ADDRESSES); what colour does Linkify use? It's not obviously in android.graphics.Color. I have a few long paragraphs of stuff I just want standard links in, and one I need to do…
Ben Williams
  • 5,838
  • 2
  • 28
  • 48
1
2 3
17 18