Code example for XmlResourceParser

Methods: close

0
 
    public void execute(int resId, XmlHandler handler) throws XmlHandlerException {
        final XmlResourceParser parser = mRes.getXml(resId);
        try { 
        	handler.setLocalSync(true);
            handler.parseAndApply(parser, mResolver);
        } finally { 
            parser.close();
        } 
    } 
     
    public void execute(Context context, String assetName, XmlHandler handler) throws XmlHandlerException {
		try { 
		    final InputStream input = context.getAssets().open(assetName);
		    final XmlPullParser parser = ParserUtils.newPullParser(input);
        	handler.setLocalSync(true);
		    handler.parseAndApply(parser, mResolver);
		} catch (XmlHandlerException e) {
		    throw e;
		} catch (XmlPullParserException e) {