Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Which of the lifecycle method will be called when an user receives any incoming call while he is on another app??
Joe Brown21,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.