Which of the following is a call-back method that inflates an options menu from file res/menu/menu.xml?
Answer(s): D
To specify the options menu for an activity, override onCreateOptionsMenu() (fragments provide their own onCreateOptionsMenu() callback). In this method, you can inflate your menu resource (defined in XML) into the Menu provided in the callback. For example:@Overridepublic boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.game_menu, menu);return true;}
http://developer.android.com/guide/topics/ui/menus.html
Which of the following Activity methods is invoked when the user clicks on an options menu item?
When the user selects an item from the options menu (including action items in the app bar), the system calls your activity's onOptionsItemSelected() method.
Which of the following WebView methods allows you to manually load custom HTML markup?
Answer(s): A
Example: To load the desired web page from an HTML string:String summary = "<html><body>You scored <b>192</b> points.</body></html>"; webview.loadData(summary, "text/html", null);
http://developer.android.com/reference/android/webkit/WebView.html
Which of the following is the base class of all UI components?
Answer(s): C
View is the base class for android.widget subclasses, which instantiate fully-implemented UI objects. Reference: http://eagle.phys.utk.edu/guidry/android/androidUserInterface.html
Post your Comments and Discuss Android AND-401 exam with other Community members:
To protect our content from bots for real learners like you, we ask you to register for free. Sign in or sign up now to continue with the AND-401 material!