开发者

Between onCreate() and onPostCreate()

开发者 https://www.devze.com 2023-02-11 13:44 出处:网络
Are there any Runnables from the UI thread MessageQueue executed between onCreate()开发者_如何学Go an onPostCreate()? In other words, is it possible that my AsyncTask\'s onPostExecute() method will be

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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消