Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/text/util/Linkify#nestedclasses) \| [Constants](https://developer.android.com/reference/android/text/util/Linkify#constants) \| [Fields](https://developer.android.com/reference/android/text/util/Linkify#lfields) \| [Ctors](https://developer.android.com/reference/android/text/util/Linkify#pubctors) \| [Methods](https://developer.android.com/reference/android/text/util/Linkify#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/text/util/Linkify#inhmethods)

# Linkify

*** ** * ** ***


`
public


class
Linkify
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.text.util.Linkify |

<br />

*** ** * ** ***

Linkify take a piece of text and a regular expression and turns all of the
regex matches in the text into clickable links. This is particularly
useful for matching things like email addresses, web URLs, etc. and making
them actionable.

Alone with the pattern that is to be matched, a URL scheme prefix is also
required. Any pattern match that does not begin with the supplied scheme
will have the scheme prepended to the matched text when the clickable URL
is created. For instance, if you are matching web URLs you would supply
the scheme `http://`. If the pattern matches example.com, which
does not have a URL scheme prefix, the supplied scheme will be prepended to
create `http://example.com` when the clickable URL link is
created.

**Note:** When using `https://developer.android.com/reference/android/text/util/Linkify#MAP_ADDRESSES` or `https://developer.android.com/reference/android/text/util/Linkify#ALL`
to match street addresses on API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#O_MR1`
and earlier, methods in this class may throw
`https://developer.android.com/reference/android/util/AndroidRuntimeException` or other exceptions if the
device's WebView implementation is currently being updated, because
`https://developer.android.com/reference/android/webkit/WebView#findAddress(java.lang.String)` is required to match street
addresses.
**See also:**

- `https://developer.android.com/reference/android/text/util/Linkify.MatchFilter`
- `https://developer.android.com/reference/android/text/util/Linkify.TransformFilter`

## Summary

| ### Nested classes ||
|---|---|
| ` interface` | `https://developer.android.com/reference/android/text/util/Linkify.MatchFilter` MatchFilter enables client code to have more control over what is allowed to match and become a link, and what is not. |
| ` interface` | `https://developer.android.com/reference/android/text/util/Linkify.TransformFilter` TransformFilter enables client code to have more control over how matched patterns are represented as URLs. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/text/util/Linkify#ALL` *This constant was deprecated in API level 33. use `https://developer.android.com/reference/android/view/textclassifier/TextClassifier#generateLinks(android.view.textclassifier.TextLinks.Request)` instead, and avoid `https://developer.android.com/reference/android/text/util/Linkify#ALL` even when targeting API levels where no alternative is available.* |
| `int` | `https://developer.android.com/reference/android/text/util/Linkify#EMAIL_ADDRESSES` Bit field indicating that email addresses should be matched in methods that take an options mask |
| `int` | `https://developer.android.com/reference/android/text/util/Linkify#MAP_ADDRESSES` *This constant was deprecated in API level 28. use `https://developer.android.com/reference/android/view/textclassifier/TextClassifier#generateLinks(android.view.textclassifier.TextLinks.Request)` instead, and avoid `https://developer.android.com/reference/android/text/util/Linkify#MAP_ADDRESSES` even when targeting API levels where no alternative is available.* |
| `int` | `https://developer.android.com/reference/android/text/util/Linkify#PHONE_NUMBERS` Bit field indicating that phone numbers should be matched in methods that take an options mask |
| `int` | `https://developer.android.com/reference/android/text/util/Linkify#WEB_URLS` Bit field indicating that web URLs should be matched in methods that take an options mask |

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/text/util/Linkify.MatchFilter` | `https://developer.android.com/reference/android/text/util/Linkify#sPhoneNumberMatchFilter` Filters out URL matches that don't have enough digits to be a phone number. |
| ` public static final https://developer.android.com/reference/android/text/util/Linkify.TransformFilter` | `https://developer.android.com/reference/android/text/util/Linkify#sPhoneNumberTransformFilter` Transforms matched phone number text into something suitable to be used in a tel: URL. |
| ` public static final https://developer.android.com/reference/android/text/util/Linkify.MatchFilter` | `https://developer.android.com/reference/android/text/util/Linkify#sUrlMatchFilter` Filters out web URL matches that occur after an at-sign (@). |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/text/util/Linkify#Linkify()() ` |

| ### Public methods ||
|---|---|
| ` static final void` | ` https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.widget.TextView,%20java.util.regex.Pattern,%20java.lang.String,%20android.text.util.Linkify.MatchFilter,%20android.text.util.Linkify.TransformFilter)(https://developer.android.com/reference/android/widget/TextView text, https://developer.android.com/reference/java/util/regex/Pattern pattern, https://developer.android.com/reference/java/lang/String scheme, https://developer.android.com/reference/android/text/util/Linkify.MatchFilter matchFilter, https://developer.android.com/reference/android/text/util/Linkify.TransformFilter transformFilter) ` Applies a regex to the text of a TextView turning the matches into links. |
| ` static final boolean` | ` https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.text.Spannable,%20java.util.regex.Pattern,%20java.lang.String,%20java.lang.String[],%20android.text.util.Linkify.MatchFilter,%20android.text.util.Linkify.TransformFilter)(https://developer.android.com/reference/android/text/Spannable spannable, https://developer.android.com/reference/java/util/regex/Pattern pattern, https://developer.android.com/reference/java/lang/String defaultScheme, https://developer.android.com/reference/java/lang/String schemes, https://developer.android.com/reference/android/text/util/Linkify.MatchFilter matchFilter, https://developer.android.com/reference/android/text/util/Linkify.TransformFilter transformFilter) ` Applies a regex to a Spannable turning the matches into links. |
| ` static final void` | ` https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.widget.TextView,%20java.util.regex.Pattern,%20java.lang.String,%20java.lang.String[],%20android.text.util.Linkify.MatchFilter,%20android.text.util.Linkify.TransformFilter)(https://developer.android.com/reference/android/widget/TextView text, https://developer.android.com/reference/java/util/regex/Pattern pattern, https://developer.android.com/reference/java/lang/String defaultScheme, https://developer.android.com/reference/java/lang/String schemes, https://developer.android.com/reference/android/text/util/Linkify.MatchFilter matchFilter, https://developer.android.com/reference/android/text/util/Linkify.TransformFilter transformFilter) ` Applies a regex to the text of a TextView turning the matches into links. |
| ` static final boolean` | ` https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.text.Spannable,%20java.util.regex.Pattern,%20java.lang.String)(https://developer.android.com/reference/android/text/Spannable text, https://developer.android.com/reference/java/util/regex/Pattern pattern, https://developer.android.com/reference/java/lang/String scheme) ` Applies a regex to a Spannable turning the matches into links. |
| ` static final boolean` | ` https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.text.Spannable,%20java.util.regex.Pattern,%20java.lang.String,%20java.lang.String[],%20android.text.util.Linkify.MatchFilter,%20android.text.util.Linkify.TransformFilter,%20java.util.function.Function<java.lang.String,android.text.style.URLSpan>)(https://developer.android.com/reference/android/text/Spannable spannable, https://developer.android.com/reference/java/util/regex/Pattern pattern, https://developer.android.com/reference/java/lang/String defaultScheme, https://developer.android.com/reference/java/lang/String schemes, https://developer.android.com/reference/android/text/util/Linkify.MatchFilter matchFilter, https://developer.android.com/reference/android/text/util/Linkify.TransformFilter transformFilter, https://developer.android.com/reference/java/util/function/Function<https://developer.android.com/reference/java/lang/String, https://developer.android.com/reference/android/text/style/URLSpan> urlSpanFactory) ` Applies a regex to a Spannable turning the matches into links. |
| ` static final boolean` | ` https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.text.Spannable,%20int)(https://developer.android.com/reference/android/text/Spannable text, int mask) ` Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links. |
| ` static final void` | ` https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.widget.TextView,%20java.util.regex.Pattern,%20java.lang.String)(https://developer.android.com/reference/android/widget/TextView text, https://developer.android.com/reference/java/util/regex/Pattern pattern, https://developer.android.com/reference/java/lang/String scheme) ` Applies a regex to the text of a TextView turning the matches into links. |
| ` static final boolean` | ` https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.text.Spannable,%20int,%20java.util.function.Function<java.lang.String,android.text.style.URLSpan>)(https://developer.android.com/reference/android/text/Spannable text, int mask, https://developer.android.com/reference/java/util/function/Function<https://developer.android.com/reference/java/lang/String, https://developer.android.com/reference/android/text/style/URLSpan> urlSpanFactory) ` Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links. |
| ` static final boolean` | ` https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.text.Spannable,%20java.util.regex.Pattern,%20java.lang.String,%20android.text.util.Linkify.MatchFilter,%20android.text.util.Linkify.TransformFilter)(https://developer.android.com/reference/android/text/Spannable spannable, https://developer.android.com/reference/java/util/regex/Pattern pattern, https://developer.android.com/reference/java/lang/String scheme, https://developer.android.com/reference/android/text/util/Linkify.MatchFilter matchFilter, https://developer.android.com/reference/android/text/util/Linkify.TransformFilter transformFilter) ` Applies a regex to a Spannable turning the matches into links. |
| ` static final boolean` | ` https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.widget.TextView,%20int)(https://developer.android.com/reference/android/widget/TextView text, int mask) ` Scans the text of the provided TextView and turns all occurrences of the link types indicated in the mask into clickable links. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Constants

### ALL

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ALL
```


**This constant was deprecated
in API level 33.**   

use `https://developer.android.com/reference/android/view/textclassifier/TextClassifier#generateLinks(android.view.textclassifier.TextLinks.Request)` instead, and avoid `https://developer.android.com/reference/android/text/util/Linkify#ALL` even when targeting API levels where no
alternative is available.

Bit mask indicating that all available patterns should be matched in methods
that take an options mask. Note that this should be avoided, as the `https://developer.android.com/reference/android/text/util/Linkify#MAP_ADDRESSES` field uses the `https://developer.android.com/reference/android/webkit/WebView#findAddress(java.lang.String)` method, which has various limitations and has been deprecated: see
the documentation for `https://developer.android.com/reference/android/webkit/WebView#findAddress(java.lang.String)` for
more information.

<br />

Constant Value:

15
(0x0000000f)


### EMAIL_ADDRESSES

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EMAIL_ADDRESSES
```

Bit field indicating that email addresses should be matched in methods
that take an options mask

<br />

Constant Value:

2
(0x00000002)


### MAP_ADDRESSES

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int MAP_ADDRESSES
```


**This constant was deprecated
in API level 28.**   

use `https://developer.android.com/reference/android/view/textclassifier/TextClassifier#generateLinks(android.view.textclassifier.TextLinks.Request)` instead, and avoid `https://developer.android.com/reference/android/text/util/Linkify#MAP_ADDRESSES` even when targeting API levels
where no alternative is available.

Bit field indicating that street addresses should be matched in methods that
take an options mask. Note that this should be avoided, as it uses the
`https://developer.android.com/reference/android/webkit/WebView#findAddress(java.lang.String)` method, which has various
limitations and has been deprecated: see the documentation for
`https://developer.android.com/reference/android/webkit/WebView#findAddress(java.lang.String)` for more information.

<br />

Constant Value:

8
(0x00000008)


### PHONE_NUMBERS

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PHONE_NUMBERS
```

Bit field indicating that phone numbers should be matched in methods that
take an options mask

<br />

Constant Value:

4
(0x00000004)


### WEB_URLS

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WEB_URLS
```

Bit field indicating that web URLs should be matched in methods that
take an options mask

<br />

Constant Value:

1
(0x00000001)


## Fields

### sPhoneNumberMatchFilter

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Linkify.MatchFilter sPhoneNumberMatchFilter
```

Filters out URL matches that don't have enough digits to be a
phone number.

<br />

### sPhoneNumberTransformFilter

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Linkify.TransformFilter sPhoneNumberTransformFilter
```

Transforms matched phone number text into something suitable
to be used in a tel: URL. It does this by removing everything
but the digits and plus signs. For instance:
'+1 (919) 555-1212'
becomes '+19195551212'

<br />

### sUrlMatchFilter

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Linkify.MatchFilter sUrlMatchFilter
```

Filters out web URL matches that occur after an at-sign (@). This is
to prevent turning the domain name in an email address into a web link.

<br />

## Public constructors

### Linkify

```
public Linkify ()
```

<br />

<br />

## Public methods

### addLinks

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final void addLinks (TextView text, 
                Pattern pattern, 
                String scheme, 
                Linkify.MatchFilter matchFilter, 
                Linkify.TransformFilter transformFilter)
```

Applies a regex to the text of a TextView turning the matches into
links. If links are found then UrlSpans are applied to the link
text match areas, and the movement method for the text is changed
to LinkMovementMethod.

<br />

| Parameters ||
|---|---|
| `text` | `TextView`: TextView whose text is to be marked-up with links. This value cannot be `null`. <br /> |
| `pattern` | `Pattern`: Regex pattern to be used for finding links. This value cannot be `null`. <br /> |
| `scheme` | `String`: URL scheme string (eg `http://`) to be prepended to the links that do not start with this scheme. This value may be `null`. <br /> |
| `matchFilter` | `Linkify.MatchFilter`: The filter that is used to allow the client code additional control over which pattern matches are to be converted into links. This value may be `null`. <br /> |
| `transformFilter` | `Linkify.TransformFilter`: This value may be `null`. <br /> |

### addLinks

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean addLinks (Spannable spannable, 
                Pattern pattern, 
                String defaultScheme, 
                String[] schemes, 
                Linkify.MatchFilter matchFilter, 
                Linkify.TransformFilter transformFilter)
```

Applies a regex to a Spannable turning the matches into links.

<br />

| Parameters ||
|---|---|
| `spannable` | `Spannable`: Spannable whose text is to be marked-up with links. This value cannot be `null`. <br /> |
| `pattern` | `Pattern`: Regex pattern to be used for finding links. This value cannot be `null`. <br /> |
| `defaultScheme` | `String`: The default scheme to be prepended to links if the link does not start with one of the `schemes` given. This value may be `null`. <br /> |
| `schemes` | `String`: Array of schemes (eg `http://`) to check if the link found contains a scheme. Passing a null or empty value means prepend defaultScheme to all links. <br /> |
| `matchFilter` | `Linkify.MatchFilter`: The filter that is used to allow the client code additional control over which pattern matches are to be converted into links. This value may be `null`. <br /> |
| `transformFilter` | `Linkify.TransformFilter`: Filter to allow the client code to update the link found. This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | True if at least one link is found and applied. <br /> |

**See also:**

- `https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.text.Spannable,%20java.util.regex.Pattern,%20java.lang.String,%20java.lang.String[],%20android.text.util.Linkify.MatchFilter,%20android.text.util.Linkify.TransformFilter,%20java.util.function.Function<java.lang.String,android.text.style.URLSpan>)`

### addLinks

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final void addLinks (TextView text, 
                Pattern pattern, 
                String defaultScheme, 
                String[] schemes, 
                Linkify.MatchFilter matchFilter, 
                Linkify.TransformFilter transformFilter)
```

Applies a regex to the text of a TextView turning the matches into
links. If links are found then UrlSpans are applied to the link
text match areas, and the movement method for the text is changed
to LinkMovementMethod.

<br />

| Parameters ||
|---|---|
| `text` | `TextView`: TextView whose text is to be marked-up with links. This value cannot be `null`. <br /> |
| `pattern` | `Pattern`: Regex pattern to be used for finding links. This value cannot be `null`. <br /> |
| `defaultScheme` | `String`: The default scheme to be prepended to links if the link does not start with one of the `schemes` given. This value may be `null`. <br /> |
| `schemes` | `String`: Array of schemes (eg `http://`) to check if the link found contains a scheme. Passing a null or empty value means prepend defaultScheme to all links. <br /> |
| `matchFilter` | `Linkify.MatchFilter`: The filter that is used to allow the client code additional control over which pattern matches are to be converted into links. This value may be `null`. <br /> |
| `transformFilter` | `Linkify.TransformFilter`: Filter to allow the client code to update the link found. This value may be `null`. <br /> |

### addLinks

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean addLinks (Spannable text, 
                Pattern pattern, 
                String scheme)
```

Applies a regex to a Spannable turning the matches into
links.

<br />

| Parameters ||
|---|---|
| `text` | `Spannable`: Spannable whose text is to be marked-up with links. This value cannot be `null`. <br /> |
| `pattern` | `Pattern`: Regex pattern to be used for finding links. This value cannot be `null`. <br /> |
| `scheme` | `String`: URL scheme string (eg `http://`) to be prepended to the links that do not start with this scheme. This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.text.Spannable,%20java.util.regex.Pattern,%20java.lang.String,%20java.lang.String[],%20android.text.util.Linkify.MatchFilter,%20android.text.util.Linkify.TransformFilter,%20java.util.function.Function<java.lang.String,android.text.style.URLSpan>)`

### addLinks

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean addLinks (Spannable spannable, 
                Pattern pattern, 
                String defaultScheme, 
                String[] schemes, 
                Linkify.MatchFilter matchFilter, 
                Linkify.TransformFilter transformFilter, 
                Function<String, URLSpan> urlSpanFactory)
```

Applies a regex to a Spannable turning the matches into links.

<br />

| Parameters ||
|---|---|
| `spannable` | `Spannable`: spannable whose text is to be marked-up with links. This value cannot be `null`. <br /> |
| `pattern` | `Pattern`: regex pattern to be used for finding links. This value cannot be `null`. <br /> |
| `defaultScheme` | `String`: the default scheme to be prepended to links if the link does not start with one of the `schemes` given. This value may be `null`. <br /> |
| `schemes` | `String`: array of schemes (eg `http://`) to check if the link found contains a scheme. Passing a null or empty value means prepend defaultScheme to all links. <br /> |
| `matchFilter` | `Linkify.MatchFilter`: the filter that is used to allow the client code additional control over which pattern matches are to be converted into links. This value may be `null`. <br /> |
| `transformFilter` | `Linkify.TransformFilter`: filter to allow the client code to update the link found. This value may be `null`. <br /> |
| `urlSpanFactory` | `Function`: function used to create `https://developer.android.com/reference/android/text/style/URLSpan`s. This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | True if at least one link is found and applied. <br /> |

### addLinks

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean addLinks (Spannable text, 
                int mask)
```

Scans the text of the provided Spannable and turns all occurrences
of the link types indicated in the mask into clickable links.
If the mask is nonzero, it also removes any existing URLSpans
attached to the Spannable, to avoid problems if you call it
repeatedly on the same text.

<br />

| Parameters ||
|---|---|
| `text` | `Spannable`: Spannable whose text is to be marked-up with links. This value cannot be `null`. <br /> |
| `mask` | `int`: Mask to define which kinds of links will be searched. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/text/util/Linkify#WEB_URLS` - `https://developer.android.com/reference/android/text/util/Linkify#EMAIL_ADDRESSES` - `https://developer.android.com/reference/android/text/util/Linkify#PHONE_NUMBERS` - `https://developer.android.com/reference/android/text/util/Linkify#MAP_ADDRESSES` - `https://developer.android.com/reference/android/text/util/Linkify#ALL` |

| Returns ||
|---|---|
| `boolean` | True if at least one link is found and applied. <br /> |

**See also:**

- `https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.text.Spannable,%20int,%20java.util.function.Function<java.lang.String,android.text.style.URLSpan>)`

### addLinks

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final void addLinks (TextView text, 
                Pattern pattern, 
                String scheme)
```

Applies a regex to the text of a TextView turning the matches into
links. If links are found then UrlSpans are applied to the link
text match areas, and the movement method for the text is changed
to LinkMovementMethod.

<br />

| Parameters ||
|---|---|
| `text` | `TextView`: TextView whose text is to be marked-up with links. This value cannot be `null`. <br /> |
| `pattern` | `Pattern`: Regex pattern to be used for finding links. This value cannot be `null`. <br /> |
| `scheme` | `String`: URL scheme string (eg `http://`) to be prepended to the links that do not start with this scheme. This value may be `null`. <br /> |

### addLinks

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean addLinks (Spannable text, 
                int mask, 
                Function<String, URLSpan> urlSpanFactory)
```

Scans the text of the provided Spannable and turns all occurrences
of the link types indicated in the mask into clickable links.
If the mask is nonzero, it also removes any existing URLSpans
attached to the Spannable, to avoid problems if you call it
repeatedly on the same text.

<br />

| Parameters ||
|---|---|
| `text` | `Spannable`: Spannable whose text is to be marked-up with links. This value cannot be `null`. <br /> |
| `mask` | `int`: mask to define which kinds of links will be searched. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/text/util/Linkify#WEB_URLS` - `https://developer.android.com/reference/android/text/util/Linkify#EMAIL_ADDRESSES` - `https://developer.android.com/reference/android/text/util/Linkify#PHONE_NUMBERS` - `https://developer.android.com/reference/android/text/util/Linkify#MAP_ADDRESSES` - `https://developer.android.com/reference/android/text/util/Linkify#ALL` |
| `urlSpanFactory` | `Function`: function used to create `https://developer.android.com/reference/android/text/style/URLSpan`s. This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | True if at least one link is found and applied. <br /> |

### addLinks

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean addLinks (Spannable spannable, 
                Pattern pattern, 
                String scheme, 
                Linkify.MatchFilter matchFilter, 
                Linkify.TransformFilter transformFilter)
```

Applies a regex to a Spannable turning the matches into
links.

<br />

| Parameters ||
|---|---|
| `spannable` | `Spannable`: Spannable whose text is to be marked-up with links. This value cannot be `null`. <br /> |
| `pattern` | `Pattern`: Regex pattern to be used for finding links. This value cannot be `null`. <br /> |
| `scheme` | `String`: URL scheme string (eg `http://`) to be prepended to the links that do not start with this scheme. This value may be `null`. <br /> |
| `matchFilter` | `Linkify.MatchFilter`: The filter that is used to allow the client code additional control over which pattern matches are to be converted into links. This value may be `null`. <br /> |
| `transformFilter` | `Linkify.TransformFilter`: Filter to allow the client code to update the link found. This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | True if at least one link is found and applied. <br /> |

**See also:**

- `https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.text.Spannable,%20java.util.regex.Pattern,%20java.lang.String,%20java.lang.String[],%20android.text.util.Linkify.MatchFilter,%20android.text.util.Linkify.TransformFilter,%20java.util.function.Function<java.lang.String,android.text.style.URLSpan>)`

### addLinks

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean addLinks (TextView text, 
                int mask)
```

Scans the text of the provided TextView and turns all occurrences of
the link types indicated in the mask into clickable links. If matches
are found the movement method for the TextView is set to
LinkMovementMethod.

<br />

| Parameters ||
|---|---|
| `text` | `TextView`: TextView whose text is to be marked-up with links. This value cannot be `null`. <br /> |
| `mask` | `int`: Mask to define which kinds of links will be searched. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/text/util/Linkify#WEB_URLS` - `https://developer.android.com/reference/android/text/util/Linkify#EMAIL_ADDRESSES` - `https://developer.android.com/reference/android/text/util/Linkify#PHONE_NUMBERS` - `https://developer.android.com/reference/android/text/util/Linkify#MAP_ADDRESSES` - `https://developer.android.com/reference/android/text/util/Linkify#ALL` |

| Returns ||
|---|---|
| `boolean` | True if at least one link is found and applied. <br /> |

**See also:**

- `https://developer.android.com/reference/android/text/util/Linkify#addLinks(android.text.Spannable,%20int,%20java.util.function.Function<java.lang.String,android.text.style.URLSpan>)`