andreluizreis
8/30/2017 - 4:52 PM

Remove item from menu programmatically. ||| Link: https://stackoverflow.com/questions/7133141/android-changing-option-menu-items-programmati

<item 
  android:id="@+id/item1"
  android:title="your Item">
</item>
@Override
public boolean onPrepareOptionsMenu(Menu menu) {

    if (mCustomerPhone == null || mCustomerPhone.equals("")) {
        menu.removeItem(R.id.menuPhoneCustomer);
        menu.removeItem(R.id.menuPhoneCustomer2);
    }
    return super.onPrepareOptionsMenu(menu);
}