Android XmlPullParser Move to Next safeNext(XmlPullParser parser)

Here you can find the source of safeNext(XmlPullParser parser)

Description

safe Next

Declaration

public static int safeNext(XmlPullParser parser) 

Method Source Code

//package com.java2s;
import java.io.IOException;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class Main {

    public static int safeNext(XmlPullParser parser) {
        try {/*from  w w  w  .  ja  v  a2  s . c  om*/
            parser.next();
            while (null == parser.getName()) {
                parser.next();
            }
            return parser.getEventType();
        } catch (XmlPullParserException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return -1;
    }
}

Related

  1. nextStartTag(XmlPullParser pp, String namespace, String name)
  2. nextStartTag(XmlPullParser pp, String namespace, String name)
  3. nextString(XmlPullParser parser, String tag)
  4. nextText(XmlPullParser pp, String namespace, String name)
  5. nextText(XmlPullParser pp, String namespace, String name)
  6. enter(final XmlPullParser pp)
  7. enter(final XmlPullParser pp, final String tagName)