AND-401 practice questions, page 8 of 9, with answer review and explanations.
Question 36
Which of the following is the base class of all UI components?
ListView
Layout
View
ViewGroup
Question 37
Which of the following is true about object arrayAdapter declared in the code below? String[] items = {"Item 1","Item 2","Item 3"}; ArrayAdapter arrayAdapter = new ArrayAdapter (this, android.R.layout.simple_list_item_1, items); listView.setAdapter(arrayAdapter);
It creates a TextView for each String in array items.
It creates Buttons for each String in array items.
It creates four views for listView.
It replaces the layout of the activity with three consecutive TextView items.
Question 38
Which of the following is NOT a correct constructer for ArrayAdapter?
ArrayAdapter(Context context)
ArrayAdapter (Context context, int recourse)
ArayAdpater (Context context , int resource, int textViewResourceId)
ArrayAdapter (Context context , int resource, List<T> items)
Question 39
Which of the following add a click listener to items in a listView?
onClickListener.
onItemClickListener.
onItemClicked.
onListItemClickListener.
Question 40
Which of the following makes a ListView Clickable?