AssertionError on android.util.Xml.parse

by Cleverson » Fri, 23 Apr 2010 06:09:40 GMT


Sponsored Links
 Hi,

I'm getting an AssertionError when calling Xml.parse. This error
usually occurs when I run the app and keep switching the phone
connectivity from Wifi to 3G and vice versa. I checked the source code
of the android.util.Xml class and see something that I couldn't not
understand well, for example

    public static void parse(InputStream in, Encoding encoding,
            ContentHandler contentHandler) throws IOException,
SAXException {
        try {
            XMLReader reader = new ExpatReader();
            reader.setContentHandler(contentHandler);
            InputSource source = new InputSource(in);
            source.setEncoding(encoding.expatName);
            reader.parse(source);
        } catch (IOException e) {
            throw new AssertionError(e);
        }
    }

Is it "normal" to handle an IOException like it is done in this class?
I mean, why catching a checked exception and turn it to an
AssertionError? Should clients be supposed to catch AssertionErrors
when calling the parse method?

Thanks in advance!

--



Other Threads

1. Ketahanan batt Rodri 1.8.1 di N

data operator nya gak idup ya? sol...

desire with miui



-- 
===============
"Indonesian Android Community [id-android]"

PING'S mobile
Email: sa...@pings-mobile.com  Ph. (021) 96087100
---------------------
Yopie Ratjoen
Email: yo...@ratjoen.com  Ph. 08977726681
--------------------
Gila original
Email: i...@gilaoriginal.com  Ph. (031) 91555898
--------------------

Aturan Jual/Kloteran ID-Android  http://goo.gl/azW7

2. android installable

Hi.

After we do <make> for the source that is downloaded from the repo,
the build system creates out. on the default folder. under
<~/mydroid/out/target/product/generic> path i have system.img
ramdisk.img and userdata.img. I want to integrate all these into
one .iso. so that i can install it on virtual box.

I am using linux-x86 and original repo. For some reasons I can't use
the customized android-x86.

Please suggest me how can i do this.

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Looking for ListAdaptor pattern

4. how do i call a make file inside Android.mk

5. Camera image lost when mobile turn to landscape

6. Javascript

7. ViewFlipper jump to 'page'