Android Application Development (AND-401) — Question 1

What Activity method you use to retrieve a reference to an Android view by using the id attribute of a resource XML?

Answer options

Correct answer: B

Explanation

The correct answer is B, as 'findViewById(int id)' is the standard method used to access a view by its ID in an Android layout. Options A and C do not exist in the Android framework, and option D is incorrect because 'findViewById' requires an integer ID, not a string.