Code example for XmlPullParser

Methods: getEventType, next, setInput

0
		} 
 
		mParser = Xml.newPullParser();
 
		try{ 
			mParser.setInput(is,null);
		} catch(XmlPullParserException e){
			Log.e(TAG, "Exception occureed while reading the XML Document", e);
			throw new ParseException("Could not create the CallSessionResult", e);
		} 
 
		int eventType;
 
		try { 
			eventType = mParser.getEventType();
		} catch (XmlPullParserException e) {
			throw new ParseException("Could not parse adResponse entity.", e);
		} 
 
		if (eventType != XmlPullParser.START_DOCUMENT) {
			throw new ParseException("", new XmlPullParserException(
					"Attempting to initialize parsing beyond the start of the document.")); 
		} 
 
		try { 
			// Gets the first eventType 
			eventType = mParser.next();
 
			// Gets the MethodResponse 
			MethodResponse response = handleMethodResponse(eventType);
 
			if ((response == null) || (! (response.isValid())))