Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Android Activity Lifecycle The Activity Lifecycle Activity Lifecycle Overview

Confusion about quiz

I'm confused about this question In the Activity Lifecycle Overview quiz: "When Android kills an activity we're not guaranteed to see any more lifecycle methods. Knowing that, which lifecycle method is not guaranteed to be called?". What I'm interpreting is "Which lifecycle method is not guaranteed to be called WHEN ANDROID KILLS AN ACTIVITY?"

Is my interpretation correct? Or does the question refer also to the cases when the activity isn't killed by Android? Because if my interpretation is correct, then onDestroy() is guaranteed to be called if Android kills the activity, which is contradictory because the correct answer according to the quiz is onDestroy().

1 Answer

Mary-Ann Burton
Mary-Ann Burton
15,834 Points

This is how I interpreted it at first as well, given the video in the course. However, if you follow the flow chart on the Android Developer website (https://developer.android.com/reference/android/app/Activity.html) it shows that the process can be killed from onPause() or onStop() as well, so I see where that answer came from. It just wasn't clarified well enough in the video for my liking.