XmlResourceParser close - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for XmlResourceParser close method.

This code example shows how to use the following methods:close
 
	public void execute(int resId, XmlHandler handler) throws XmlHandler.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 XmlHandler.XmlHandlerException {
		try { 
			final InputStream input = context.getAssets().open(assetName);
			final XmlPullParser parser = ParserUtils.newPullParser(input);
		    handler.setLocalSync(true);
			handler.parseAndApply(parser, mResolver);
		} catch (XmlHandler.XmlHandlerException e) {
			throw e;
		} catch (XmlPullParserException e) {
5
CodeRank
This code example shows how to use the following methods:close
    } 
 
    public void execute(int resId, XmlHandler handler) throws HandlerException {
        final XmlResourceParser parser = mRes.getXml(resId);
        try { 
            handler.parseAndApply(parser, mResolver);       
        } finally { 
            parser.close();
        } 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:close
 
    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) {
5
CodeRank
This code example shows how to use the following methods:close
    } 
 
    public void execute(int resId, XmlHandler handler) throws HandlerException {
        final XmlResourceParser parser = mRes.getXml(resId);
        try { 
            handler.parseAndApply(parser, mResolver);
        } finally { 
            parser.close();
        } 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:close
 
	public void run() { 
		try { 
			loadMaterials(parser, guiBlocksBitmap, guiBlocks2Bitmap, guiBlocks3Bitmap, guiBlocks4Bitmap, terrainBitmap, itemsBitmap);
		} finally { 
			parser.close();
		} 
	} 
 
	public static void loadMaterials(XmlPullParser parser, Bitmap guiBlocksBitmap, Bitmap guiBlocks2Bitmap, Bitmap guiBlocks3Bitmap, Bitmap guiBlocks4Bitmap,
			Bitmap terrainBitmap, Bitmap itemsBitmap) {
		Map<MaterialKey, MaterialIcon> retval = new HashMap<MaterialKey, MaterialIcon>();
		try { 
			while (parser.next() != XmlPullParser.END_DOCUMENT) {
				String tagName = parser.getName();
				short itemId = 0;
				short itemDamage = 0;
				boolean itemHasSubtypes = false;
				String itemIconString = null;
				if (tagName != null && tagName.equals("item")) {
5
CodeRank

Related XmlResourceParser close Questions & Answers:

close Method Overview
Close this interface to the resource.
See Code Examples for other Android XmlResourceParser Methods: