IT月光

导航

xstream解析xml

private void getdata() {
        new Thread(){
            public void run() {
                String str=MyUtils.Check_xml(MyUtils.url);
                XStream xStream=new XStream();
                xStream.processAnnotations(SuperNews.class);
                SuperNews sn=(SuperNews) xStream.fromXML(str);
                List<Tweet> list=sn.getTweets().getTweet();
                handler.sendMessage(handler.obtainMessage(1, list));
            };
        }.start();
    }

 

posted on 2016-04-23 11:58  IT月光  阅读(134)  评论(0编辑  收藏  举报