AND-401 Exam QuestionsBrowse all questions from this exam

AND-401 Exam - Question 105


Which of the following applies a context menu on a ListView (Choose two)?

Show Answer
Correct Answer: BC

To apply a context menu on a ListView, you need to register the ListView with the context menu using the registerForContextMenu() method. This can be done by obtaining the ListView either through getListView() or by finding it using findViewById(), and then passing it to the registerForContextMenu() method. Therefore, both B and C are correct as they correctly show these implementations.

Discussion

1 comment
Sign in to comment
MmadiOptions: BC
Dec 31, 2022

B. ListView lv = getListView(); registerForContextMenu(lv); C. ListView lv = (ListView) findViewByld(R.id.list_view_id); registerForContextMenu(lv)