owh mostly for being more memory efficient ? :D

I have tried with the AsyncTask, which seemed like a great option for
me (especially being able to do an updateProgress) but unfortunately
my situation is somewhat more complex :(
In my situation I have a main class (with the main UI Thread
obviously), then I have the piece of code I pasted at the beginning
which starts the parsing (which I placed within a AsyncTask) and then
obviously I have my ExampleHandler for the actual XML parsing...
So i'd like to show on the UI how far the parsing is, especially
because atm while debugging my device takes 3 whole minutes to debug
around 1800 XML Elements !
The problem obviously relies in the fact that the call to the parsing
is in the AsyncTask, NOT the ExampleHandler itself, and it's the
ExampleHandler who knows how far it is with parsing...
So my question would be :
Is there some way for me to keep the Xml.parse() code in a AsyncTask
class and actually get the updates from within the Handler ?
Also, does a Handler actually spawn it's own Thread, btw my
ExampleHandler extends DefaultHandler ? Should I be placing the
ExampleHandler (or extending it) within a AsyncTask instead of the
call to Xml.parse() ?
I am actually somewhat confused atm :(

On 9 feb, 17:32, Frank Weiss <[email protected]> wrote:
> The AsyncTask pattern already provides a thread (from a pool) that you can
> use anytime you need one. It's not at all clear why you need a singleton XML
> parser.

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

Reply via email to