Exam AND-401 All QuestionsBrowse all questions from this exam
Question 31

What two methods you have to override when implementing Android option menus?

    Correct Answer: C

    To specify the options menu for an activity, you override onCreateOptionsMenu(). This method is where you inflate your menu resource into the Menu provided in the callback. When the user selects an item from the options menu, the system calls your activity's onOptionsItemSelected() method. This method handles the menu item clicks. Therefore, the two methods you have to override when implementing Android option menus are onCreateOptionsMenu and onOptionsItemSelected.

Discussion
MmadiOption: C

C. onCreateOptionsMenu, onOptionsItemSelected

MmadiOption: A

A. onCreateOptionsMenu, onCreateContextMenu