Android Linkify使电话号码无法点击

Android Linkify使电话号码无法点击,android,linkify,Android,Linkify,我试图用简单的代码在textview中创建可点击的电话号码0900-123 4567。在一些手机和安卓版本上,它可以工作,在一些手机上则不行。大多数情况下,只有0900-123是可点击的,4567是不可添加的。有时,当电话语言为英语时,可以单击同一电话号码,但当语言为法语时,不能单击。你知道怎么把它修好,在任何地方都能用吗 acceptMatch过程被命中并始终返回true TextView tv = (TextView) findViewById(R.id.test); Pattern

我试图用简单的代码在textview中创建可点击的电话号码0900-123 4567。在一些手机和安卓版本上,它可以工作,在一些手机上则不行。大多数情况下,只有0900-123是可点击的,4567是不可添加的。有时,当电话语言为英语时,可以单击同一电话号码,但当语言为法语时,不能单击。你知道怎么把它修好,在任何地方都能用吗

acceptMatch过程被命中并始终返回true

TextView tv = (TextView) findViewById(R.id.test);
    Pattern pattern = Pattern.compile("[0-9]{4}-[0-9]{3} [0-9]{4}");

    Linkify.MatchFilter matchFilter = new Linkify.MatchFilter() {
        @Override
        public final boolean acceptMatch(CharSequence s, int start, int end) {
            if (s != null && s.subSequence(start,end).toString().equals("0900-123 4567"))
                return true;
            else
                return false;
        }
    };

    Linkify.addLinks(tv, pattern, "tel:", matchFilter, null);

<TextView
    android:id="@+id/test"
    android:clickable="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:autoLink="phone"
    android:text="Hello 0900-123 456 (some other text)."/>
TextView电视=(TextView)findviewbyd(R.id.test);
Pattern=Pattern.compile(“[0-9]{4}-[0-9]{3}[0-9]{4}”);
Linkify.MatchFilter MatchFilter=新的Linkify.MatchFilter(){
@凌驾
公共最终布尔接受匹配(字符序列,整数开始,整数结束){
如果(s!=null&&s.subSequence(start,end).toString()等于(“0900-123 4567”))
返回true;
其他的
返回false;
}
};
addLinks(电视,图案,“电话:”,匹配过滤器,空);

我在textview上尝试了文本和自动链接。对我有用。没有使用linkify和模式编写任何代码。我在textview上尝试了文本和自动链接。对我有用。没有使用linkify和模式编写任何代码。