Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/212.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何解决:在Android中使用linkify类时无法切换?_Android - Fatal编程技术网

如何解决:在Android中使用linkify类时无法切换?

如何解决:在Android中使用linkify类时无法切换?,android,Android,参考上面的链接,当我测试样本并添加linkify getView函数时,切换不起作用 public View getView(int position, View convertView, ViewGroup parent) { SpeechView sv; if (convertView == null) { sv = new SpeechView(mContext, myTitle[po

参考上面的链接,当我测试样本并添加linkify getView函数时,切换不起作用

public View getView(int position, View convertView, ViewGroup parent) {

            SpeechView sv;           

            if (convertView == null) {
                sv = new SpeechView(mContext, myTitle[position], myContent[position], mExpanded[position]);
            } else {

                sv = (SpeechView)convertView;                
                sv.setTitle(myTitle[position]);
                sv.setDialogue(myContent[position]);
                sv.setExpanded(mExpanded[position]); 

                TextView body = (TextView)sv.getChildAt(1);
                body.setTextColor(Color.GRAY); 

                body.setText(myContent[position]);
                Linkify.addLinks(body, Linkify.PHONE_NUMBERS);     

               body.setMovementMethod(LinkMovementMethod.getInstance());                     


            }

            TextView title = (TextView)sv.getChildAt(0);
            title.setTextColor(Color.LTGRAY);              


            return sv;
        }