Android Application Development - AND-401 Exam Practice Test

Which of the following classes should be extended to create a custom view?
Correct Answer: C
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?
Correct Answer: B
What two methods you have to override when implementing Android context menus?
Correct Answer: C
When creating a file using android.content.Context.openFileOutput("test.txt", 0), where is the file created?
Correct Answer: B
Which Consider the following code:
Intent i = new Intent(this, MainActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i);
What best explains the code above?
Correct Answer: C
Which of these is the incorrect method for an Application to save local data?
Correct Answer: C
Which is the correct explanation of ListView?
Correct Answer: D