Code example for Attributes

Methods: getIndex, getValue

0
        // picture.attributes 
        picture.getChild("attributes").setStartElementListener(new StartElementListener() {
 
            @Override 
            public void start(Attributes attributes) {
                if (attributes.getIndex("spoiler") > -1) {
                    String spoiler = attributes.getValue("spoiler");
                    imageHolder.isSpoiler = ("1".equals(spoiler));
                } 
            } 
        }); 
 
        try { 
            Xml.parse(stream, Xml.Encoding.UTF_8, root.getContentHandler());
            return caches.values();
        } catch (SAXException e) {
            Log.e("Cannot parse .gpx file as oc11xml: could not parse XML", e);
            return null; 
        } 
    }