解决方案 »

  1.   

    把获取count的代码放倒switch里面
    switch (eventType) {
                case XmlPullParser.START_TAG:
                    if ("smss".equals(tagName)) {
                       System.out.println(parser.getAttributeValue(null, "count"));
                    } else if ("body".equals(tagName)) {
                        body = parser.nextText();
                    } else if ("address".equals(tagName)) {
                        address = parser.nextText();
                    } else if ("type".equals(tagName)) {
                        type = parser.nextText();
                    } else if ("date".equals(tagName)) {
                        date = parser.nextText();
                    }
                    Log.i(TAG, "读取中");
                    break;