Greetings. Not long ago, I began to study android and now the question arose (in the title). I would be very grateful for the help, as I still strongly “swim” in the abundance of classes and methods in the SDK.
public boolean onPrepareOptionsMenu(Menu menu) { //вызывается при вызове меню MenuItem action_mail = menu.findItem(R.id.action_item4); if (chb2.isChecked()){ action_mail.setVisible(true); supportInvalidateOptionsMenu(); }else{ action_mail.setVisible(false); supportInvalidateOptionsMenu(); } menu.setGroupVisible(R.id.groupID, chb1.isChecked()); return super.onPrepareOptionsMenu(menu); } 