The crash "This Activity already has an action bar supplied by the window decor" happens because:
- The app has no internet
- Toast is called too often
- A theme with an ActionBar is used together with setSupportActionBar(toolbar)
- The menu XML is missing
Answer
C) A theme with an ActionBar is used together with setSupportActionBar(toolbar)
Use a NoActionBar theme when you set a Toolbar as the app bar.
Computer Science MCQ · More Lab: Menus and Messages MCQs · Practise