I create a menu in an activity with the following code:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu1, menu);
return true;
}
But so, I can open and close the menu any time. I want that the menu can be opened if a boolean is true, if the boolean is false, the user should not be able to open the menu...