问题
Is onCreateOptionsMenu()
of action bar called before or after the onStart()
of activity?
回答1:
onStart() is called first. (I tried putting log messages in the methods).
回答2:
I found this order to be the correct one
onCreate() - onStart() - onResume()- onCreateOptionsMenu()
回答3:
This is only called once, the first time the options menu is displayed. To update the menu every time it is displayed, see onPrepareOptionsMenu(Menu).
This is written in the Android documentation.
来源:https://stackoverflow.com/questions/22340598/what-is-the-call-order-of-oncreateoptionsmenu-in-the-android-activity-lifecycl