Skip to content Skip to sidebar Skip to footer

Disable Menu Button?

I have a custom menu options that I want to disable it from popping up if a button on screen is clicked.. I thought of using this code but it doesnt work: @Override public boolea

Solution 1:

According to the documentation:

You must returntruefor the menu to be displayed; if you returnfalse it will not be shown.

So I'm guessing this will work:

@OverridepublicbooleanonPrepareOptionsMenu(Menu menu) {
     .... Code .....
     return !Schedule;
 }

That is assuming that you want the menu to display when Schedule is equal to false.

Post a Comment for "Disable Menu Button?"