Why should both portrait and landscape layouts use the same view IDs?

  1. Because IDs control colours
  2. To save memory
  3. It is required by Gradle
  4. So the same Kotlin/Java code (findViewById) works with either layout
Answer

D) So the same Kotlin/Java code (findViewById) works with either layout

Code references IDs; matching IDs avoid null views.

Computer Science MCQ · More Screen Components and Orientation MCQs · Practise