AND-401

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?

  1. ListView
  2. Layout
  3. View
  4. 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);

  1. It creates a TextView for each String in array items.
  2. It creates Buttons for each String in array items.
  3. It creates four views for listView.
  4. 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?

  1. ArrayAdapter(Context context)
  2. ArrayAdapter (Context context, int recourse)
  3. ArayAdpater (Context context , int resource, int textViewResourceId)
  4. ArrayAdapter (Context context , int resource, List<T> items)

Question 39

Which of the following add a click listener to items in a listView?

  1. onClickListener.
  2. onItemClickListener.
  3. onItemClicked.
  4. onListItemClickListener.

Question 40

Which of the following makes a ListView Clickable?

  1. setClickable(true)
  2. setVisibility(View.Visible)
  3. setEnabled(true)
  4. setItemsEnabled(true)