From 0848c89ee4d1c7937b149c65f30460227af4e586 Mon Sep 17 00:00:00 2001 From: Prateek Date: Wed, 26 Dec 2018 10:30:33 -0800 Subject: [PATCH] Added an interesting tid-bit (#29214) This is asked in a bunch of interviews and as trick question in quizzes too. --- guide/english/android-development/core-components/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/guide/english/android-development/core-components/index.md b/guide/english/android-development/core-components/index.md index 840d0a5699..83f470fd42 100644 --- a/guide/english/android-development/core-components/index.md +++ b/guide/english/android-development/core-components/index.md @@ -51,6 +51,7 @@ An activity facilitates the following key interactions between system and app: > The final call you receive before your activity is destroyed. This can happen either because the activity is finishing (someone called finish() on it), or because the system is temporarily destroying this instance of the activity to save space. You can distinguish between these two scenarios with the isFinishing() method. This call is often used when the user hits the back button, or closes the instance of the app. +Interestingly, when app display changes orientation (e.g., from landscape to portrait or the other way around), `onDestroy()` and `onCreate()` are called. This means that the Activity is recreated. This comes in handy in applications with different defined rules for landscape and portrait modes, or with different views defined for tablets and phones in these modes. #### Sample code to understand Activity Lifecycle