On Wed, Jan 27, 2010 at 5:22 PM, Frank Weiss fewe...@gmail.com 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.
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)
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
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
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
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 this
6 matches
Mail list logo