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

2010-01-31 Thread Mark Murphy
> 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

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

2010-01-31 Thread Streets Of Boston
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

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

2010-01-31 Thread Petroleum Nasby
On Wed, Jan 27, 2010 at 5:22 PM, Frank Weiss wrote: > When you say "thread", I hope you mean AsyncTask. That's the recommended > way to run background tasks, such as network downloads, and reliably handle > the resuslts in the UI thread > On Android 1.5, AsyncTask single-threads. Android 1.5 is s

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

2010-01-28 Thread Biosopher
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 Asy

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

2010-01-27 Thread Frank Weiss
When you say "thread", I hope you mean AsyncTask. That's the recommended way to run background tasks, such as network downloads, and reliably handle the resuslts in the UI thread. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to t

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

2010-01-27 Thread Biosopher
I've tracked the problem down to a rather odd place: Handler. The first post networking call is kicked off on a separate thread when the user clicks a button. When this call returns its result, a Handler is spawned to update the UI and also download the image data for display in a newly created