Re: [android-developers] XmlSerializer issue

2010-12-24 Thread Frank Weiss
Eclipse has a Java debugger. Have you used it?

In my experience, breakpointing and stepping through code is the best way to
find out why code isn't working the way you expect it to.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] XmlSerializer issue

2010-12-23 Thread Batkhuu Regsuren
I have the following code:

public void doSerialize() throws XmlPullParserException,
IllegalArgumentException, IllegalStateException, IOException   {
StringWriter writer = new StringWriter();
XmlSerializer serializer =
XmlPullParserFactory.newInstance().newSerializer();
serializer.setOutput(writer);
serializer.startDocument(null, null);
serializer.startTag(null, START);
for (int i = 0; i  20; i++) {
serializer.attribute(null, ATTR + i, VAL  + i);
}
serializer.startTag(null, DATA);
for (int i = 0; i  500; i++) {
serializer.attribute(null, attr + i, value  + i);
}

serializer.endTag(null, DATA);
serializer.endTag(null, START);
serializer.endDocument();

String xml = writer.toString(); // value: until 493rd attribute
int n = xml.length();  // value: 10125
}

The problem is that the serializer fails to serialize/write
everything. What could be possible reason? Any pointer would be
greatly appreciated.

Thank you in advance.

Rex

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en