Android Lifecycle Triggers, Part 2
Yesterday I showed how lifecycle events fire in response to starting and stopping an Activity. Next, let’s see what happens when you change the display orientation:
That’s what happens without any customization. I marked two methods bold because they are different than yesterday’s diagram. See this comment from Ed Burnette for more details on customizing rotation behavior. Specifically, you can retain data by overriding
onRetainNonConfigurationInstance(), or you can prevent activity destruction via the
android:configChanges XML attribute.
Android is also useful as a telephone, believe it or not. This next diagram shows what happens when a phone call interrupts an Activity: