1. When I click on the menu item of the option menu (optionsmenu: Click menu popup), call the onmenuitemselected also call the onoptionsitemselected, so I wonder what they are different. Then look at the context menu (ContextMenu: pops up when the control is long pressed. For example, when you press and hold Edittextview to pop up the input method to select a menu), when you click on the menu item in the context menu, the call to Onmenuitemselected also calls the oncontextitemselected, so the problem is clear. In the Onmenuitemselected method of the parent activity, if the option menu goes onmenuitemselected, the context menu goes oncontextitemselected. 2. Onprepareoptionsmenu: Call onoptionsmenuclosed before the Options menu is displayed: Called when the options menu is closed Oncontextmenuclosed: Called when the context menu is closed
onoptionsitemselected, onmenuitemselected, oncontextitemselected differences in Android development