Re: [android-developers] onPostExecute and Activity State

2011-01-23 Thread Mark Murphy
On Sun, Jan 23, 2011 at 3:55 PM, Dianne Hackborn wrote: > There actually isn't a special state for orientation changes.  We just > specify that the implementation will do the destruction of the old activity > and construction of the new activity during processing of a single message, > so no other

Re: [android-developers] onPostExecute and Activity State

2011-01-23 Thread Dianne Hackborn
There actually isn't a special state for orientation changes. We just specify that the implementation will do the destruction of the old activity and construction of the new activity during processing of a single message, so no other messages can be dispatched while it is doing this. That is, the

Re: [android-developers] onPostExecute and Activity State

2011-01-23 Thread Kostya Vasilyev
Yes, there is that special case for orientation changes, thank you, but it's temporary. I suppose also if the UI thread is stuck on something and is heading for an ANR, then it's not processing messages either. Under normal conditions, the UI thread does process messages - here is a simple test (

Re: [android-developers] onPostExecute and Activity State

2011-01-23 Thread Mark Murphy
On Sun, Jan 23, 2011 at 12:56 PM, Kostya Vasilyev wrote: > so your onPostExecute will get called as soon as > doInBackground completes. Not necessarily. When doInBackground() completes, the background thread from the thread pool sends a Message to a Handler, to cause onPostExecute() to be run o

Re: [android-developers] onPostExecute and Activity State

2011-01-23 Thread Kostya Vasilyev
Doug, AsyncTask doesn't know anything about Activity lifecycle (and can be used with other app components). As far as messaging goes, the UI thread continues to run and process messages even if no activities are visible (there may be messages related to services or app widgets, and also that's ho

[android-developers] onPostExecute and Activity State

2011-01-23 Thread Doug Gordon
After the background thread of an AsyncTask has completed (i.e., doInBackground returns), it is stated that onPostExecute runs "on the UI thread". Can I assume that if the activity has gone into the "paused" state or other non-active state, that onPostExecute will not be called until the activi