On Sat, Sep 10, 2011 at 10:13 AM, bob <[email protected]> wrote: > That's a possibility. Or, I might use this function I wrote: > > void replaceCurrentTask(android.os.AsyncTask<Void, Void, Long> > newTask){ > if (currentTask != null) { > > currentTask.cancel(true); > while (!currentTask.isCancelled() && > currentTask.getStatus()! > =AsyncTask.Status.FINISHED) trytosleep(1); > } > > currentTask=newTask; > currentTask.execute(); > > }
Yuck. Use a LinkedBlockingQueue and your own thread working jobs off of that queue, rather than AsyncTask. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.0 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] 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

