Sunday, January 31, 2010

[android-developers] Re: Multi-threaded http requests cause exception

Petroleam is right about AsyncTask using a thread-pool of only one
thread on 1.5. Higher versions of Android use a pool of more than one
thread.

You can do something similar with ExecutorService and FutureTask
classes (java.util.concurrent; i believe that AsyncTask is based upon
these classes) and tell the ExecutorService to use Thread-pools of any
size.


On Jan 28, 11:36 am, Biosopher <biosop...@gmail.com> wrote:
> Hi Frank,
>
> Thanks for pointing me back to AsyncTask.  I had seen AsyncTask but
> hadn't updated my code to it.  Instead I had relied on Threads and
> Handlers as they had worked without a problem before.  I'm still
> unsure why the Thread and Handler setup wasn't working, but now that
> I've updated to AsyncTask everything is working great.
>
> Thanks!

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate