Most visited

Recently visited

Added in API level 1

Linkify.MatchFilter

public static interface Linkify.MatchFilter

android.text.util.Linkify.MatchFilter


MatchFilter使客户端代码可以更好地控制允许匹配的内容,并成为一个链接,而不是。 例如:匹配网址时,您希望像http://www.example.com这样的内容匹配网址,以及example.com自己。 但是,您不希望与[email protected]中的域匹配。 因此,如果匹配网页网址格式,您可能还会加入一个MatchFilter,如果匹配立即以符号(@)开头,则不允许匹配。

Summary

Public methods

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

检查与模式匹配的字符跨度,并确定是否应将匹配转换为可操作的链接。

Public methods

acceptMatch

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

检查与模式匹配的字符跨度,并确定是否应将匹配转换为可操作的链接。

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

Hooray!