Code example for SubMenu

Methods: add

0
        courbes.add(0, NO_ID, 0, "NO");
        courbes.add(0, EXP_ID, 1, "Exp");
        courbes.add(0, SIN_ID, 2, "Sin");
 
        SubMenu duration = menu.addSubMenu("Duration");
        duration.add(1, 500, 0, "1/2s");
        duration.add(1, 1000, 0, "1s");
        duration.add(1, 3000, 1, "3s");
        duration.add(1, 5000, 2, "5s");
        return true; 
    } 
 
    @Override 
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case EXP_ID:
                curve = EXP_ID;
                break; 
            case SIN_ID:
                curve = SIN_ID;
                break;