Code example for XmlPullParser

Methods: getEventType, next

0
     * Moves the parser to the next element. 
     */ 
    public static boolean next(XmlPullParser parser) {
        try { 
            if (hasNext(parser)) {
                parser.next();
                return true; 
            } 
            return false; 
        } catch (Exception e) {
            return false; 
        } 
    } 
 
    public static boolean hasNext(XmlPullParser parser) throws XmlPullParserException {
        int event = parser.getEventType();
        if (event == XmlPullParser.END_DOCUMENT) {
            return false; 
        } else { 
            return true; 
        }