public static void setVisibleEnabled(final Menu menu, final int itemId, final boolean visible, final boolean enabled) {
        final MenuItem item = menu.findItem(itemId);
        setVisible(item, visible);
        setEnabled(item, enabled);
    }
Sets enabled state for given menu item (without crashing on null item)
main/src/main/java/cgeo/geocaching/utils/MenuUtils.java