开发者

How to solve : doesn't work toggle when using linkify class in Android?

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List6.html

Taking Referece of the above link, whenI test sample and I added linkify getView function, does not work toggle.

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;
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜