Android XmlPullParser Read readInt(XmlPullParser parser)

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

Description

read Int

License

Open Source License

Declaration

public static int readInt(XmlPullParser parser) throws IOException,
            XmlPullParserException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class Main {
    public static int readInt(XmlPullParser parser) throws IOException,
            XmlPullParserException {/*  www.  j  a  v a2s  . c om*/
        String result = "";
        if (parser.next() == XmlPullParser.TEXT) {
            result = parser.getText();
            parser.nextTag();
        }
        return Integer.parseInt(result);
    }
}

Related

  1. readBooleanAttribute(XmlPullParser in, String name)
  2. readBooleanAttribute(XmlPullParser in, String name, boolean defaultValue)
  3. readByteArrayAttribute(XmlPullParser in, String name)
  4. readDate(XmlPullParser parser, String tagName, String dateFormat)
  5. readFloatAttribute(XmlPullParser in, String name)
  6. readIntAttribute(XmlPullParser in, String name)
  7. readIntAttribute(XmlPullParser in, String name)
  8. readIntAttribute(XmlPullParser in, String name, int defaultValue)
  9. readInteger(XmlPullParser parser, String ns, String tag)