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

LifeCycle Methods

Which of the lifecycle method will be called when an user receives any incoming call while he is on another app??

1 Answer

Joe Brown
Joe Brown
21,465 Points

You mean which lifecycle method will be called in the "other app" if it is interrupted by the phone app? If so I think it would depend on the phone app on the phone. On my new phone when someone calls, and I am currently using an app, the phone app only puts up a sort of widget on the top of the screen, so whatever app I am currently using is still visible in the background. In that case it should be onPause() that is called in the other app since that app is still visible in the background. If the phone app brings up an Activity that takes over the entire screen then onDestroy() should be the last lifecycle method called in the other app. According to how the lifecycle is explained on the developer site.