Android XmlPullParser Value Get loadIntArrayByParser(XmlPullParser parser)

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

Description

load Int Array By Parser

Declaration

public static int[] loadIntArrayByParser(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[] loadIntArrayByParser(XmlPullParser parser) {
        String line;//from www .j ava  2s . c  o m
        try {
            line = parser.nextText();
            line = line.trim();
            line = line.replace("\\r\\n", " ");
            line = line.replace("\n", " ");
            String[] szStrings = line.split("[ ]+");
            int length = szStrings.length;
            int[] re = new int[length];
            for (int i = 0; i < length; i++) {
                re[i] = Integer.parseInt(szStrings[i]);
            }
            return re;
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. getRequiredAttributeValue(XmlPullParser pp, String namespace, String name)
  2. getRequiredAttributeValue(XmlPullParser pp, String namespace, String name)
  3. getValuesMap(XmlPullParser parser)
  4. loadFloatArrayByParser(XmlPullParser parser)
  5. loadFloatByParser(XmlPullParser parser)
  6. loadStringArrayByParser(XmlPullParser parser)
  7. GetFullName(XmlPullParser reader)
  8. extractChildText(XmlPullParser paramXmlPullParser)
  9. extractFirstChildTextIgnoreRest( XmlPullParser paramXmlPullParser)