Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about Activity lifecycle #7

Open
leerduo opened this issue Apr 20, 2016 · 1 comment
Open

question about Activity lifecycle #7

leerduo opened this issue Apr 20, 2016 · 1 comment

Comments

@leerduo
Copy link

leerduo commented Apr 20, 2016

Hi,When i read about Activity lifecycle in chapter 4,your book said when an Activity is paused and then rotated,how is the lifecycle going? Here i add a new button to StopWatch app,and when click the button,start a new Activity,and the new Activity‘s theme is Theme.Dialog,so when start the Activity,my StopWatchActivity is in onPause method,at this moment,I rotate my device,onStop->onDestroy->onCreate->onStart->onResume->onPause is called,but the book said onResume is not called,how to understand this?

@linucksrox
Copy link

I would recommend you use the log functions inside of each of the activity lifecycle methods, then monitor logcat while your app moves through each of them. This will give you a better understanding of exactly if/when each method is called, and in what order. onResume should be called after onStart, so what you are seeing is correct. Have a look at Google's documentation:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants