How about copying the AsyncTask code into your app and modifying to do what you want? I think this is a lot cleaner than going to contortions to work around the API to use it in ways that probably aren't intended.
On Mon, Jun 15, 2009 at 11:32 PM, Sven Bendel <ben...@cs.uni-bonn.de> wrote: > > Thanks for the fast answers! > > Unfortunately I found out, that I can't use AsyncTask for my task > anyway... > > The get() method seems to provide a neat way to pseudo-join the > AsyncTask and the main UI-thread - I found it yesterday evening, too, > and played around with it a little bit. The only problem is, that if > you use it in the main thread, it will wait for the result of > doInBackground and execute all the onProgressUpdate stuff *after* > doInBackground has finished - this destroys all parallelism you > intended to create using the AsyncTask wrapper. That's the reason why > I can't use AsyncTask and in fact threads in general for my purposes > because join() would do the same thing... > > Regards, > Sven > > PS.: @Streets of Boston: I've tried your idea of writing setter/getter > methods for the AsyncTask - background thread and it works! The only > problem is, that when I try to join the main and the AsyncTask thread > I get a deadlock as the main thread waits for the background thread to > die, but it seems, that it dies *after* the last onProgressUpdated() > was executed which is a task of the (now waiting!!!) main thread. But > nevertheless I'm happy to have gained access to the background thread > - maybe I can use this in another context. Thanks again! > > > -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---