Code example for AssetManager: Using file assets

Methods: open

0
	// Methods 
	// =========================================================== 
 
	public TexturePack loadFromAsset(final AssetManager pAssetManager, final String pAssetPath) throws TexturePackParseException {
		try { 
			return this.load(pAssetManager, pAssetManager.open(this.mAssetBasePath + pAssetPath));
		} catch (final IOException e) {
			throw new TexturePackParseException("Could not load " + this.getClass().getSimpleName() + " data from asset: " + pAssetPath, e);
		} 
	} 
 
	public TexturePack load(final AssetManager pAssetManager, final InputStream pInputStream) throws TexturePackParseException {
		try{ 
			final SAXParserFactory spf = SAXParserFactory.newInstance();
			final SAXParser sp = spf.newSAXParser();
 
			final XMLReader xr = sp.getXMLReader();
			final TexturePackParser texturePackerParser = new AssetTexturePackParser(this.mTextureManager, pAssetManager, this.mAssetBasePath);
			xr.setContentHandler(texturePackerParser);