androidlayoutviewoptions-menu

Moving options menu to another view


I am trying to display the options menu in another place but the ActionBar, is it is hidden. I have no clue on how to do it nor I find any function to do such things.

I am using Theme.Light.NoTitleBar as theme/style, but still I'd like to have the menu somewhere else, be it a View or a Layout.

Does anyone have any clue?


Solution

  • You would need to use Android support library , which would enable you to use Action Bar in Android Version 11.0 and above. You would also require to use Theme.Holo.Light.DarkActionBar as your application theme to make action bar visible.

    After you do this , you may create menu xml file ad inflate it in onCreateOptionsMenu() function , and you can then access Action Bar like this : getActionBar() in your activity.