Which of the following is a correct Android Manifest statement?

Which of the following is a correct Android Manifest statement? A. <uses-permission android:name =”android.Internet”/> B. <uses-permission android:name =”android.Internet”></uses-permission> C. <uses-permission android:name =”android.permission.Internet”> D. <uses-permission android:name =”android. permission .Internet”/> Explanation: References:Android ATC Self Study Guide http://www.androidatc.com/pages-19/Self-Study Show Answer

Read More

How to enable JavaScript in WebView?

How to enable JavaScript in WebView? A. myWebView. setJavaScriptEnabled(true); B. myWebView.getJavaScriptSettings.setEnabled(true) C. myWebView.getSettings().setJavaScriptEnabled(true); D. Java script is always enabled in WebView Explanation: JavaScript is disabled in a WebView by default. You can enable it through the WebSettings attached to your WebView. You can retrieve WebSettings withgetSettings(), then enable JavaScript with setJavaScriptEnabled(). For example:WebView myWebView = […]

Read More

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

What two methods you have to override when implementing Android context menus? A. onCreateOptionsMenu, onCreateContextMenu B. onCreateContextMenu, onContextItemSelected C. onCreateOptionsMenu, onOptionsItemSelected D. onCreateOptionsMenu, onContextItemSelected Explanation: need to create context menu. For this need to override this method: @Overridepublic void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.setHeaderTitle("My Context Menu"); menu.add(0, NEW_MENU_ITEM, 0, […]

Read More

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

What two methods you have to override when implementing Android option menus? A. onCreateOptionsMenu, onCreateContextMenu B. onCreateContextMenu, onContextItemSelected C. onCreateOptionsMenu, onOptionsItemSelected D. onCreateOptionsMenu, onContextItemSelected Explanation: To specify the options menu for an activity, override onCreateOptionsMenu(). When the user selects an item from the options menu (including action items in the app bar), the system calls […]

Read More

Which of the following is a call-back method that inflates an options menu from file res/menu/menu.

Which of the following is a call-back method that inflates an options menu from file res/menu/menu.xml? A. onOptionsItemSelected B. onCreate C. onCreateMenu D. onCreateOptionsMenu Explanation: To specify the options menu for an activity, override onCreateOptionsMenu() (fragments provide their own onCreateOptionsMenu() callback). In this method, youcan inflate your menu resource (defined in XML) into the Menu […]

Read More

Which of the following Activity methods is invoked when the user clicks on an options menu item?

Which of the following Activity methods is invoked when the user clicks on an options menu item? A. onItemClicked B. onItemSelected C. onOptionsItemClicked D. onOptionsItemSelected Explanation: 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. References:http://developer.android.com/guide/topics/ui/menus.html Show Answer

Read More