Ok, so in a project I'm in, we are implementing a service to handle
connection changes and downloads. The service handles a queue of AsyncTasks,
each representing a "download task". This way, we can cancel/pause tasks
when connection drops, and also restore them when connection is
reestablished. Since the threads AsyncTasks are run are not deterministic,
how many ATs should I execute() at the same time?

I've read that I shouldn't reuse tasks. How can I achieve this pause->resume
functionality then? Should I tell the thread to sleep? Should I make a no-op
while if connection is down? I was trusting the cancel(true) method, which
I've read is not reliable either.

My main DownloadTask is a subclass of AsyncTask that returns a new AsyncTask
to be called when the connection is restored. Is that a good solution?

Claudio Roberto França Pereira (a.k.a. Spidey)
hardMOB - HTForum - @spideybr
Engenharia de Computação - UFES 2006/1

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

Reply via email to