[Android]Menu events
onCreateOptionsMenu
- Trigged the first time an Activity’s menu is displaed
- Can Define a menu for an Activity
- Menu.add() method
- Menu.addSubMenu() method
- Can use Menu resource in Xml file
- MenuInflator.inflate() method
onOptionsItemSelected
- MenuItem.getItemId() method and R.id.xxx
- When the menu item selected
onPrepareOptionsMenu
- Can modify a Menu based on an application’s current state
onCreateContextMenu
- Can define a Context Menu
- registerForContextMenu(view) : Can register Activity-specific Context Menu for an Activity
- Can use Menu resource in Xml file
- MenuInflator.inflate() method
onContextItemSelected
- When the context menu item selected
Categories: Android
Android, mobile, programming
Comments (0)
Trackbacks (0)
Leave a comment
Trackback