Code example for SubMenu

Methods: add

0
        this.view = view;
    } 
 
    boolean createOptionsMenu(Menu menu) {
        SubMenu settingMenu = menu.addSubMenu("Settings");
        settingMenu.add(0, MENU_SETTINGS_CYCLES, 0, "Cycles");
        settingMenu.add(0, MENU_SETTINGS_FRAMESKIP, 0, "Frameskip");
        settingMenu.add(0, MENU_SETTINGS_MEMORY_SIZE, 0, "Memory Size");
        settingMenu.add(0, MENU_SETTINGS_SOAP_VIDEO, 0, "Soap Video")
                .setCheckable(true).setChecked(soapVideo);
        settingMenu.add(0, MENU_SETTINGS_AUDIO_ENABLED, 0, "Audio Enabled")
                .setCheckable(true).setChecked(audioEnabled);
        menu.add(0, MENU_KEYBOARD, 0, "Keyboard");
        menu.add(0, MENU_QUIT, 0, "Quit");
        return true; 
    } 
 
    boolean prepareOptionsMenu(Menu menu) {
        menu.findItem(MENU_SETTINGS_SOAP_VIDEO).setChecked(soapVideo);
        menu.findItem(MENU_SETTINGS_AUDIO_ENABLED).setChecked(audioEnabled);
Connect your IDE to all the code out there  Get Codota for Java