How I get Attribute using by XMLPull parser

前端 未结 2 467
暗喜
暗喜 2020-12-06 16:24

I have an xml file and I show the small part of it, to show the content what I want



        
2条回答
  •  温柔的废话
    2020-12-06 17:12

    private String readLink(XmlPullParser parser) throws IOException, XmlPullParserException {
        parser.require(XmlPullParser.START_TAG, ns, "enclosure");
        final String link = parser.getAttributeValue(null, "url");
        return link;
    }
    

    This works for me in android with XmlPullParser.

提交回复
热议问题