Java Code Examples for org.xmlpull.v1.XmlPullParserException.printStackTrace()

The following are Jave code examples for showing how to use printStackTrace() of the org.xmlpull.v1.XmlPullParserException class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: boohee_v5.6   File: c.java   Source Code and License Vote up 5 votes
private static void a(byte[] bArr) {
    if (a == null) {
        try {
            a = XmlPullParserFactory.newInstance().newPullParser();
            a.setFeature("http://xmlpull.org/v1/doc/features.html#process-namespaces", true);
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        }
    }
    a.setInput(new InputStreamReader(new ByteArrayInputStream(bArr)));
}
 
Example 2
Project: xbrowser   File: LayoutInflater.java   Source Code and License Vote up 5 votes
private LayoutInflater(Reader reader) {
    try {
        XmlPullParserFactory factory= XmlPullParserFactory.newInstance();
        parser=factory.newPullParser();
        parser.setInput(reader);
    } catch (XmlPullParserException e) {
        e.printStackTrace();
    }
}
 
Example 3
Project: FrameAnimationView   File: FrameAnimView.java   Source Code and License Vote up 4 votes
private void loadFromXml(int resourceId) {
    XmlResourceParser parser = getContext().getResources().getXml(
            resourceId);
    try {
        int eventType = parser.getEventType();
        while (eventType != XmlPullParser.END_DOCUMENT) {
            if (eventType == XmlPullParser.START_DOCUMENT) {

            } else if (eventType == XmlPullParser.START_TAG) {
                String name = parser.getName();
                if (!TextUtils.isEmpty(name) && name.equals("animation-list")) {
                    int size = parser.getAttributeCount();
                    for (int i = 0; i < size; i++) {
                        if (parser.getAttributeName(i).equals(
                                "oneshot")) {
                            mLoop = !parser.getAttributeBooleanValue(
                                    i, true);
                        }
                    }
                }
                if (parser.getName().equals("item")) {
                    for (int i = 0; i < parser.getAttributeCount(); i++) {
                        if (parser.getAttributeName(i).equals(
                                "drawable")) {
                            int resId = Integer.parseInt(parser
                                    .getAttributeValue(i)
                                    .substring(1));
                            if (resId != 0)
                                mRes.add(resId);
                        } else if (parser.getAttributeName(i)
                                .equals("duration")) {
                            duration = parser.getAttributeIntValue(
                                    i, 1000);
                        }
                    }
                }
            } else if (eventType == XmlPullParser.END_TAG) {
            } else if (eventType == XmlPullParser.TEXT) {
            }
            eventType = parser.next();
        }
    } catch (IOException e) {
        e.printStackTrace();
    } catch (XmlPullParserException e2) {
        e2.printStackTrace();
    }
}