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