Android: When is onCreateOptionsMenu called during Activity lifecycle?

The onCreate method is called first, and before it finishes onCreateOptionsMenu is called.

That will be true on devices and apps with an official Honeycomb-style action bar. If there is no action bar, onCreateOptionsMenu() should not get called until the user calls up the menu, typically by pressing the MENU button.

(I’m using screen size to determine this, my layout file for large screens has a View I check for after the layout is inflated)

That test will break very shortly, once Ice Cream Sandwich ships. From what I can tell, ICS phones will have action bars (though perhaps not system bars).

Leave a Comment