Items can be added to a menu in code using:

  1. addView()
  2. menu.insertItem()
  3. menu.add(groupId, itemId, order, title)
  4. setItems()
Answer

C) menu.add(groupId, itemId, order, title)

Menu.add() creates items programmatically.

Computer Science MCQ · More Lab: Menus and Messages MCQs · Practise