Which is an advantage of defining UI in XML?

  1. It runs faster than any other method
  2. It is the only way to create UI
  3. Separation of design from code and support for alternative layouts
  4. It needs no resources
Answer

C) Separation of design from code and support for alternative layouts

XML keeps layout separate and lets Android choose configuration-specific files.

Computer Science MCQ · More Action Bar and User Interface Design MCQs · Practise