Most Common Android Problems — Android Pitfalls 🐭 🧀
What does happens when a screen is rotated? Before we think about this question let’s try to understand how does Android deal with that.
When a user rotates their phone the configuration of the Activity changes, so android OS destroys the Activity and recreates it again.
Behind the scenes; when the device orientation changes, first the Activity will disappear for a millisecond when the onPause, onStop, and onDestroy methods are called. After a few milliseconds, the activity will be restarted and the onCreate, onStart, and onResume methods are called.