fhucho
fhucho

Reputation: 34530

Between onCreate() and onPostCreate()

Are there any Runnables from the UI thread MessageQueue executed between onCreate() an onPostCreate()? In other words, is it possible that my AsyncTask's onPostExecute() method will be called in between?

Upvotes: 7

Views: 13871

Answers (2)

ViramP
ViramP

Reputation: 1709

onPostCreate() call after onStart.

onCreate() is first state of new activity.

onPostCreate() behave same as onCreate() when activity come from on another activity.

FYI :onPostCreate() not well document.

Upvotes: 1

sstn
sstn

Reputation: 3069

onPostCreate() is mainly intented for framework use (although you can override it). The docs say that it is called after onStart() and onRestoreInstanceState().

This might lead to the assumption that it might be called before onResume() and thus probably before the message loop is dispatching events (including AsyncTask's onPostExecute() method), meaning your onPostExecute() will only fire after onPause().

As onPostCreate() is not properly documented and not really intended for application use - I might want to say it is not a good idea to rely on any observed behaviour.

Upvotes: 16

Related Questions