Adding an onclick to a submenu?
问题 I have an onclick function for my menu but I can't figure out what the ID is for my submenu so that I can tell the submenu what to do when the user click on it. I created my submenu programmatically using the code below. So if someone could please explain to me how I know what the id is for each item of the submenu I'd greatly appreciate it. @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.mainmenu, menu); SubMenu