Which method makes a Toolbar act as the activity's action bar?

  1. toolbar.attach()
  2. setActionBar(true)
  3. setSupportActionBar(toolbar)
  4. supportActionBar = toolbar
Answer

C) setSupportActionBar(toolbar)

setSupportActionBar() installs the Toolbar as the app bar.

Computer Science MCQ · More Action Bar and User Interface Design MCQs · Practise