Which method is used to get a reference to a view defined in XML?
- getLayout()
- setContentView()
- getView()
- findViewById()
Answer
D) findViewById()
findViewById(R.id.viewId) returns the view object with that id.
Computer Science MCQ · More Lab: Android Studio Setup and First App MCQs · Practise