Skip to content

Most visited

Recently visited

navigation
added in API level 1

Linkify.MatchFilter

public static interface Linkify.MatchFilter

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. For example: when matching web URLs you would like things like http://www.example.com to match, as well as just example.com itelf. However, you would not want to match against the domain in support@example.com. So, when matching against a web URL pattern you might also include a MatchFilter that disallows the match if it is immediately preceded by an at-sign (@).

Summary

Public methods

abstract boolean acceptMatch(CharSequence s, int start, int end)

Examines the character span matched by the pattern and determines if the match should be turned into an actionable link.

Public methods

acceptMatch

added in API level 1
boolean acceptMatch (CharSequence s, 
                int start, 
                int end)

Examines the character span matched by the pattern and determines if the match should be turned into an actionable link.

Parameters
s CharSequence: The body of text against which the pattern was matched

start int: The index of the first character in s that was matched by the pattern - inclusive

end int: The index of the last character in s that was matched - exclusive

Returns
boolean Whether this match should be turned into a link

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)