Sunday 15 June 2014

android - How to instantiate menu object? -


I am trying to hide and show the menu item in my action bar

I click on the item, then I run the function called showAddFrag (). Inside that function, I am trying to hide the menu items so my code is something like this:

  public zeros show addFrag () {menu menu = new menu (); // giving me this error: "menu menu" menu can not be started. Fundament (R.id.add_item) .setVisible (false); // add_item is hiding the menu item ....}   

I know that I am doing it wrong, but someone can tell me in the right direction, is there a function that I Can I reference context menu objects?

In advance thanks

You can use this callback: onPrepareOptionsMenu () And this method: menu.findItem (..) to save your button as an example variable

Then click on one of your buttonsclicklist which once it will disable it.

I hope you are trying to do this

No comments:

Post a Comment