Kotlin Program - Study Mode
[#116] Where do you define the items for a menu?
Correct Answer
(C) In a menu_name.xml file in the res > menu folder, add an <item> tag for each menu item. Create separate XML files for each separate menu.
[#117] Your app contains a physics simulation that requires heavy computation to display. Then the user gets a phone call. Which of the following is true?
Correct Answer
(B) During the phone call, you should stop computing the positions of objects in the physics simulation.
[#118] To make a class lifecycle-aware through the Android lifecycle library, which interface should the class implement?
Correct Answer
(D) LifecycleObserver
[#119] Under which circumstances does the onCreate() method in your activity receive a Bundle with data in it (that is, the Bundle is not null)?
Correct Answer
(A) The activity is restarted after the device is rotated.
[#120] How do you create a single-line comment in Kotlin?
Correct Answer
(A) // This is a comment