Android adding a submenu to a menuItem, where is addSubMenu()?

后端 未结 8 891
情歌与酒
情歌与酒 2020-12-01 04:55

I want to add a submenu inside my OptionsMenu to a menuItem, programatically according to my parameters. I\'ve checked \"MenuItem\" in android sdk and there is no addSubMenu

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-01 05:39

    To provide a comprehensive example of Phil's answer, here is my complete, working XML for a menu with two choices, each of which is a menu with three choices. I intend to add a third menu to the top level ...

    
    
        
    
            
                
    
                
    
                
            
        
    
        
    
            
                
    
                
    
                
            
        
    
    

提交回复
热议问题