Android oncreateoptionsmenu not being called

Android oncreateoptionsmenu not being called

Posted: serp Date: 26.06.2017

The app if for target sdk 16, it's composed by a tab and each tab is a fragment. On the Fragment class, during the onCreate I'm calling setHasOptionsMenu true.

android - onCreateOptionsMenu not called when starting new activity - Stack Overflow

The theme is Theme. If I run the app on the emulator Android 4. I don't think the problem is on the sdk version, because the actionbar is visible!

If the device does not have a hardware button, it shows as a drop-down from the action bar. If the device does have a hardware button, it shows as a rise-up from near the menu button.

If the menu is on the action bar, it's only created once because the menus stays on the screen, does not go away like on hardware key phones , so there's another callback, I reckon it's onPrepareOptionsMenu or something similar, that one is called before the menu is shows on the screen.

By posting your answer, you agree to the privacy policy and terms of service.

android - onCreateOptionsMenu is not called - Stack Overflow

Stack Overflow Questions Developer Jobs Documentation beta Tags Users. Sign up or log in to customize your list.

Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us.

Log In Sign Up. Join the Stack Overflow Community. Stack Overflow is a community of 7. Join them; it only takes a minute: Thanks a lot for every help! My best regards Manuela. What if i want a full screen application?

eclipse - Android Min SDK Version vs. Target SDK Version - Stack Overflow

The system adapts itself to the hardware it's running on. If I run the app on a device HTC OneS, there is not a menu button, only Home and Back buttons there is the same behaviour.

android oncreateoptionsmenu not being called

I re-read your post it's something else. I'll update the answer. I've added the overrided method onPrepareOptionsMenu and also onOptionsItemSelected but on the action bar I can see only the title. Sign up or log in StackExchange. Sign up using Facebook.

Android Studio SQLite Database Example

Sign up using Email and Password. Post as a guest Name. Stack Overflow works best with JavaScript enabled. My best regards Manuela android android-actionbar share improve this question.

NoTitleBar" share improve this answer. MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3. Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.

Rating 4,6 stars - 341 reviews
inserted by FC2 system