Here you can find the source of safeNext(XmlPullParser parser)
public static int safeNext(XmlPullParser parser)
//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; } }