Lesson 7: Activity and fragment lifecycles

  1. 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?
  2. Which lifecycle method should you override to pause the simulation when the app is not on the screen?
  3. To make a class lifecycle-aware through the Android lifecycle library, which interface should the class implement?
  4. Under which circumstances does the onCreate() method in your activity receive a Bundle with data in it (that is, the Bundle is not null)?
  5. Which lifecycle method is called to make an activity visible?
  6. Which lifecycle method is called to give an activity focus?