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.

265 questions
6
votes
1 answer

Ruby linkify for urls in strings

There have been a few posts about linkifying text using a regex. The most popular is this post. However my spec is a little more tricky: describe TextFormatter do def l(input) TextFormatter.gsub_links!(input){|link| "!!#{link}!!"} end …
Sam Saffron
  • 128,308
  • 78
  • 326
  • 506
5
votes
2 answers

Linkify adds Text to the End of Links

I would like to add a link to a textview and have the following code: TextView textview = (TextView) findViewById(R.id.mytext); Pattern myPattern = Pattern.compile("WordToBeLinked"); String link =…
Philipp Redeker
  • 3,848
  • 4
  • 26
  • 34
5
votes
2 answers

Android: Format Font in Alert Dialog

I have two questions 1) Does anyone know, how to apply styles or formatting to alert dialog. I currently use Builder builder = new AlertDialog.Builder(this); And use setMessage() method to set the content. 2) Also I would like to know how to change…
Vivek
  • 4,526
  • 17
  • 56
  • 69
5
votes
1 answer

Linkify not working with custom pattern

I'm trying to use Linkify with a custom pattern which is supposed to match phone numbers which are either 10 or 11 digits long. I've written the following code - Pattern japPhoneNoPattern =…
omerjerk
  • 4,090
  • 5
  • 40
  • 57
5
votes
1 answer

Linkify inconsistency

I have a list with photos like Instagram, with text that has links to hashtags and users using # and @ and I'm using Linkify to make this work. The 1st item in my list gets the links correct 8/10 times but the other times its just plain text. The…
Jonas Borggren
  • 2,591
  • 1
  • 22
  • 40
5
votes
2 answers

android autolink is too aggressive

Phones with SDK 20+ think that any two words with a dot between them is a link. How can I make my own Link detector? android:autoLink="web" thinks abra.kadabra is an url. setAutoLinkMask(Linkify.WEB_URLS); thinks abra.kadabra is an url. Phones with…
pv-gni
  • 51
  • 2
5
votes
3 answers

Android Linkify - Clickable telephone numbers

So I am trying to add the functionality that when you click on a phone number it would take you to the Dialer app with the pre-populated number. I have the code below: mContactDetailsText.setText(phonetextBuilder.toString()); Pattern…
James King
  • 2,425
  • 7
  • 30
  • 45
5
votes
4 answers

Link spans are lost from ListView's convertView

Why links in ListView are lost, when scrolling? From debugging it's clear, that spans are not added second time on a TextView from the convertView. Here's a piece of code which is called from adapter's getView. ... String body =…
ViliusK
  • 11,345
  • 4
  • 67
  • 71
5
votes
1 answer

Android - How to stop Linkify on Long-Press?

I am working on my project where I have a listView and each item is a LinaerLayout that has a TextView with Linkify hyperlink. So, when I press the an item in the List view, it opens a dialog, which is fine. When I press the linked text in the…
user2062024
  • 3,541
  • 7
  • 33
  • 44
5
votes
1 answer

Enable onContextMenu when auto link detection is present

I have a list item view , and I add this properties android:autoLink="web|email|phone" android:linksClickable="true" autoUrlDetect="true" but the problem is when an link is detected the context menu is not…
Lukap
  • 31,523
  • 64
  • 157
  • 244
5
votes
2 answers

Linkify Regex Function PHP Daring Fireball Method

So, I know there are a ton of related questions on SO, but none of them are quite what I'm looking for. I'm trying to implement a PHP function that will convert text URLs from a user-generated post into links. I'm using the 'improved' Regex from…
Jeff
  • 191
  • 3
  • 14
4
votes
2 answers

Dynamic Linkify Text in ListView - Error : no intent found with data : specified url

i am creating a listview. in that list each item has text view. and in text views i am defining linkify texts based on data from the web service.. now when i click on that linkify text i am getting error like 09-21 20:27:38.031:…
MKJParekh
  • 34,073
  • 11
  • 87
  • 98
4
votes
3 answers

Android Linkify text in dialog

Hi I've gone through all of the different linkify tutorials I could find but none of them work here is my current code: final SpannableString s = new SpannableString("Please send any questions to email@fake.com"); Linkify.addLinks(s,…
user577732
  • 3,956
  • 11
  • 55
  • 76
4
votes
2 answers

LInkify block onclick event

I have some TextView objects that I have onclick listeners assigned to. The onclick listeners work fine unless I run Linkify.addLinks on the TextView objects, at which point the onclick event never happens. This happens regardless of whether…
atraudes
  • 2,368
  • 2
  • 21
  • 31
4
votes
1 answer

Linkify html content to load it into webview

I load some html string to a webview and I want to linkify phone numbers, addresses and emails. But if i use Spannable to pass html content into Linkify.addLinks() method all html layout breaks down. String htmlText =…
AinisSK
  • 306
  • 1
  • 10
1 2
3
17 18