HippoMan wrote: > 1. Is it the case that if execute() is called multiple times before > all of the background tasks have completed, then it is possible that > doInBackground() might be called with more than one argument; i.e., > one for each execute() call that is currently being processed?
No. You can pass several arguments to execute(), though. > 2. If I am iterating through multiple varargs items in > doInBackground(), can I count on the fact that this method will not be > interrupted by other doInBackground() calls for other execute() > invocations that might be made against the same AsyncTask object? AsyncTask objects are not reusable, so you will only ever be called with doInBackground() once. > 3. If there are multiple arguments being passed to doInBackground(), > at what point will onPostExecute() get called? When doInBackground() returns. > I presume it's some > time after this particular call to doInBackground() completes > processing all of its varargs arguments, correct? Yes, bearing mind that there is only one call to doInBackground(). > 4. Consider this timeline? (can it even occur?) ... > A. execute() gets called on a given AsyncTask object. > B. execute() gets called on the same AsyncTask object. Your phone probably explodes at this point, throwing shrapnel that injures several people in the area. Or, perhaps, it just crashes. It is tough to tell sometimes. :-) Again, as the documentation for AsyncTask states, "The task can be executed only once (an exception will be thrown if a second execution is attempted.)" http://developer.android.com/reference/android/os/AsyncTask.html -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in US: 14-18 June 2010: http://bignerdranch.com -- 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

