nerdexam
Android

AND-401 · Question #9

Which of the following is true about object arrayAdapter declared in the code below? String[] items = {"Item 1","Item 2","Item 3"}; ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this…

The correct answer is A. It creates a TextView for each String in array items. See the full explanation below for the reasoning.

Question

Which of the following is true about object arrayAdapter declared in the code below? String[] items = {"Item 1","Item 2","Item 3"}; ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items); listView.setAdapter(arrayAdapter);

Options

  • AIt creates a TextView for each String in array items.
  • BIt creates Buttons for each String in array items.
  • CIt creates four views for listView.
  • DIt replaces the layout of the activity with three consecutive TextView items.

How the community answered

(48 responses)
  • A
    81% (39)
  • B
    4% (2)
  • C
    2% (1)
  • D
    13% (6)

Community Discussion

No community discussion yet for this question.

Full AND-401 Practice