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)- A81% (39)
- B4% (2)
- C2% (1)
- D13% (6)
Community Discussion
No community discussion yet for this question.