Hi all,

I'm using a helper thread to post data back to a web site. What I
notice is that I'm
getting an Application Not Responding back in the main thread even
though it's
not doing anything other than interrupting the helper thread to wake
up. If the
amount of data in the post is small (~ couple hundred bytes), I don't
have a
problem, but when it gets moderately large (~ 10kb) it reliably stalls
the main
UI thread and gets (appropriately) an ANR. Even weirder is that if I
time from
when I start the post to when it receives the entire reply (ie, using
Date().getTime())
in the helper thread, it shows that it's only taking about .5 seconds
to complete,
even though it  takes ~10 seconds to become responsive again.

This *only* seems to be the case writing the post data. If I do a post
of a small
amount of data with a large amount of data coming back from a web
site, the
app remains responsive and unlike the above problem, the timing
numbers in
the thread agree with how long it actually took.

FWIW, I'm using HttpURLConnection to create and read/write the data,
and
I'm aware that I need to use Handler to affect the UI from the helper
thread.
Also: this is on the G1 hardware. I've also fiddled with priorities,
etc, to
no avail, so I'm pretty stumped as to why the helper thread is
interacting
with the UI thread.

Mike

--~--~---------~--~----~------------~-------~--~----~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to