Consider the following: <?xml version="1.0" encoding="utf-8"?>
<menu
Xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/create_new"
Android:title="@string/create_new" />
<item android:id="@+id/open"
Android:title="@string/open" />
</menu> public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId() ) { case R.id.create_new: newFile() ; return true default: return super.onOptionsItemSelected(item) ; } } Upon clicking on one of the menu items, the application did not behave as intended. Which of the following might be the cause of this problem? (Choose two)
A) The developer did not set onClickListener on the menu item.
B) The developer did not include "R.id.open" in the switch case.
C) The developer should create onOptionsItemSelected method for each menu item.
D) The developer did not override the activity method "onCreateOptionsMenu" and enflate the given menu layout.
Correct Answer:
Verified
Q212: Which of the following statements are correct
Q213: When the user clicks on an action
Q214: You are building an application that supports
Q215: Which of the following is NOT true
Q216: Which of the following functions is used
Q218: Consider the following AndroidManifest.xml file. <?xml version="1.0"
Q219: Which of the following statements are correct
Q220: Which of the following permissions is not
Q221: Which of the following functions does not
Q222: Which of the following is the correct
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents