You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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:
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?
The text was updated successfully, but these errors were encountered: