Android Application Development (AND-401) — Question 104

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

Answer options

Correct answer: B, C

Explanation

Options B and C correctly demonstrate how to register a ListView for a context menu. Option A is incorrect because the method call to registerForContextMenu() on the ListView instance is not valid in this context. Option D is also incorrect since setContextMenuEnabled(true) is not a valid method for enabling context menus on a ListView.