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

Consider the following the code:

public boolean onCreateOptionsMenu(Menu menu) {

MenuInflater inflater = getMenuInflater();

inflater.inflate(R.menu.game_menu, menu);

return true;

}

Which of the following is true about the code above?

    Correct Answer: C

    The method onCreateOptionsMenu is used to populate the options menu when the user accesses it on the app. In the method, the MenuInflater is used to inflate an XML file from the res/menu folder into menu items, making option C the correct answer.

Discussion
MmadiOption: C

C. This function inflates an XML file in the res/menu folder into menu items