Code example for SubMenu

Methods: addsetIcon

0
        MenuItem item5 = menu.add(0,4,0,"item5");
        item5.setIcon(android.R.drawable.ic_menu_camera);
         
        //���j���[�A�C�e���U�̒lj� 
        SubMenu item6 = menu.addSubMenu(0,5,0,"���̑�");
        item6.setIcon(android.R.drawable.ic_menu_more);
        item6.add(0,10,0,"subitem1");
        item6.add(0,20,0,"subitem2");
         
        return true;  
    } 
 
     
    //���j���[�A�C�e���I������ 
    @Override 
    public boolean onOptionsItemSelected(MenuItem item){
    	 
    	//�_�C�A���O�ɕ\�����郁�b�Z�[�W������ 
    	String msg = "";
    	 
Connect your IDE to all the code out there  Get Codota for Java