Android Application Development AND-401 Exam Questions in PDF

Free Android AND-401 Dumps Questions (page: 7)

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

  1. onCreateOptionsMenu, onCreateContextMenu
  2. onCreateContextMenu, onContextItemSelected
  3. onCreateOptionsMenu, onOptionsItemSelected
  4. onCreateOptionsMenu, onContextItemSelected

Answer(s): B

Explanation:

Need to create context menu. For this need to override this method:
@Override
public 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, "new");
menu.add(0, SAVE_MENU_ITEM, 1, "save");
}
And last one need to handle menu clicks:
@Override
public boolean onContextItemSelected(MenuItem item) {
switch (item.getItemId()) {
case NEW_MENU_ITEM:
doSomething();
break;
case SAVE_MENU_ITEM:
doSomething();
break;
}
return super.onContextItemSelected(item);
}


Reference:

https://thedevelopersinfo.wordpress.com/2009/11/06/using-context-menus-in-android/



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

  1. onCreateOptionsMenu, onCreateContextMenu
  2. onCreateContextMenu, onContextItemSelected
  3. onCreateOptionsMenu, onOptionsItemSelected
  4. onCreateOptionsMenu, onContextItemSelected

Answer(s): C

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 your activity's onOptionsItemSelected() method. This method passes the MenuItem selected. You can identify the item by calling getItemId(), which returns the unique ID for the menu item (defined by the android:id attribute in the menu resource or with an integer given to the add() method). You can match this ID against known menu items to perform the appropriate action.
For example:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Etc.


Reference:

http://developer.android.com/guide/topics/ui/menus.html



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

  1. onOptionsItemSelected
  2. onCreate
  3. onCreateMenu
  4. onCreateOptionsMenu

Answer(s): D

Explanation:

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:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.game_menu, menu);
return true;
}


Reference:

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?

  1. onItemClicked
  2. onItemSelected
  3. onOptionsItemClicked
  4. onOptionsItemSelected

Answer(s): D

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.


Reference:

http://developer.android.com/guide/topics/ui/menus.html



Which of the following WebView methods allows you to manually load custom HTML markup?

  1. loadData
  2. loadHTML
  3. loadCustomData
  4. loadCustomHTML

Answer(s): A

Explanation:

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);


Reference:

http://developer.android.com/reference/android/webkit/WebView.html



Share your comments for Android AND-401 exam with other users:

S
Sasuke
7/11/2023 10:30:00 PM

please upload the dump. thanks very much !!

V
V
7/4/2023 8:57:00 AM

good questions

T
TTB
8/22/2023 5:30:00 AM

hi, could you please update the latest dump version

T
T
7/28/2023 9:06:00 PM

this question is keep repeat : you are developing a sales application that will contain several azure cloud services and handle different components of a transaction. different cloud services will process customer orders, billing, payment, inventory, and shipping. you need to recommend a solution to enable the cloud services to asynchronously communicate transaction information by using xml messages. what should you include in the recommendation?

G
Gurgaon
9/28/2023 4:35:00 AM

great questions

W
wasif
10/11/2023 2:22:00 AM

its realy good

S
Shubhra Rathi
8/26/2023 1:12:00 PM

oracle 1z0-1059-22 dumps

L
Leo
7/29/2023 8:48:00 AM

please share me the pdf..

A
AbedRabbou Alaqabna
12/18/2023 3:10:00 AM

q50: which two functions can be used by an end user when pivoting an interactive report? the correct answer is a, c because we do not have rank in the function pivoting you can check in the apex app

R
Rohan Limaye
12/30/2023 8:52:00 AM

best to practice

A
Aparajeeta
10/13/2023 2:42:00 PM

so far it is good

V
Vgf
7/20/2023 3:59:00 PM

please provide me the dump

D
Deno
10/25/2023 1:14:00 AM

i failed the cisa exam today. but i have found all the questions that were on the exam to be on this site.

C
CiscoStudent
11/15/2023 5:29:00 AM

in question 272 the right answer states that an autonomous acces point is "configured and managed by the wlc" but this is not what i have learned in my ccna course. is this a mistake? i understand that lightweight aps are managed by wlc while autonomous work as standalones on the wlan.

P
pankaj
9/28/2023 4:36:00 AM

it was helpful

U
User123
10/8/2023 9:59:00 AM

good question

V
vinay
9/4/2023 10:23:00 AM

really nice

U
Usman
8/28/2023 10:07:00 AM

please i need dumps for isc2 cybersecuity

Q
Q44
7/30/2023 11:50:00 AM

ans is coldline i think

A
Anuj
12/21/2023 1:30:00 PM

very helpful

G
Giri
9/13/2023 10:31:00 PM

can you please provide dumps so that it helps me more

A
Aaron
2/8/2023 12:10:00 AM

thank you for providing me with the updated question and answers. this version has all the questions from the exam. i just saw them in my exam this morning. i passed my exam today.

S
Sarwar
12/21/2023 4:54:00 PM

how i can see exam questions?

C
Chengchaone
9/11/2023 10:22:00 AM

can you please upload please?

M
Mouli
9/2/2023 7:02:00 AM

question 75: option c is correct answer

J
JugHead
9/27/2023 2:40:00 PM

please add this exam

S
sushant
6/28/2023 4:38:00 AM

please upoad

J
John
8/7/2023 12:09:00 AM

has anyone recently attended safe 6.0 certification? is it the samq question from here.

B
Blessious Phiri
8/14/2023 3:49:00 PM

expository experience

C
concerned citizen
12/29/2023 11:31:00 AM

52 should be b&c. controller failure has nothing to do with this type of issue. degraded state tells us its a raid issue, and if the os is missing then the bootable device isnt found. the only other consideration could be data loss but thats somewhat broad whereas b&c show understanding of the specific issues the question is asking about.

D
deedee
12/23/2023 5:10:00 PM

great help!!!

S
Samir
8/1/2023 3:07:00 PM

very useful tools

S
Saeed
11/7/2023 3:14:00 AM

looks a good platform to prepare az-104

M
Matiullah
6/24/2023 7:37:00 AM

want to pass the exam

AI Tutor 👋 I’m here to help!