MCQ King
Android Studio – 33 – Handling Screen Orientation Changes
1 / 25
1. What is screen orientation in Android?
2 / 25
2. Why is handling screen orientation changes important in Android apps?
3 / 25
3. What happens when the screen orientation changes in Android?
4 / 25
4. How can you prevent the recreation of an activity on screen orientation change?
5 / 25
5. What does “android:configChanges” attribute in AndroidManifest.xml do?
6 / 25
6. Which configuration change flags can you specify in “android:configChanges”?
7 / 25
7. What happens to the activity’s lifecycle when screen orientation changes occur?
8 / 25
8. Which lifecycle methods are called when an activity is recreated due to screen orientation change?
9 / 25
9. How can you handle UI changes when screen orientation changes occur?
10 / 25
10. What is onSaveInstanceState() used for in Android?
11 / 25
11. What is onRestoreInstanceState() used for in Android?
12 / 25
12. How can you save and restore UI state in onSaveInstanceState() and onRestoreInstanceState()?
13 / 25
13. What is the purpose of using “onSaveInstanceState()” and “onRestoreInstanceState()” methods?
14 / 25
14. How can you prevent specific UI components from being affected by screen orientation changes?
15 / 25
15. What does the “orientation” configuration change flag do?
16 / 25
16. What is the alternative to using “android:configChanges” to handle orientation changes?
17 / 25
17. How can ViewModel help in handling orientation changes?
18 / 25
18. What is the purpose of using a ViewModel in handling UI data during orientation changes?
19 / 25
19. How does ViewModel retain data across configuration changes?
20 / 25
20. What is a benefit of using ViewModel for handling UI data during orientation changes?
21 / 25
21. What is the purpose of the “onConfigurationChanged()” method in Android?
22 / 25
22. How can you use “onConfigurationChanged()” to handle orientation changes?
23 / 25
23. What is the primary advantage of using ViewModel for UI data retention?
24 / 25
24. How does ViewModel help reduce code complexity when handling orientation changes?
25 / 25
25. What is the recommended approach for handling orientation changes in modern Android apps?
Your score is
Restart quiz