Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Between onCreate() and onPostCreate()

Tags:

android

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?

like image 295
fhucho Avatar asked Feb 16 '11 10:02

fhucho


1 Answers

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.

like image 129
sstn Avatar answered Sep 19 '22 03:09

sstn