What Happens When Screen Orientation Changes in Android?
Contents When You Rotate Your Device and the Screen Changes Orientation, Android Usually Destroys Your Application’s Existing Activities and Fragments and...
When you rotate your device and the screen changes orientation, Android usually destroys your application’s existing Activities and Fragments and recreates them. Android does this so that your application can reload resources based on the new configuration.
What happens when orientation change happens in Android?
If orientation changes is not handle properly then it results unexpected behavior of the application. When such changes occurs, Android restarts the running Activity means it destroy and again created.
When the screen changes orientation from portrait to landscape in Android?
In this method, when you switch from Portrait to Landscape, a method is called, onConfigurationChanged method. In this method, you need to write your own custom codes to update the resource inside the Activity. Question: When this method called? So after declaring this attribute inside the Manifest file.