Android-Cheat-sheet icon indicating copy to clipboard operation
Android-Cheat-sheet copied to clipboard

onRestart() is not called after rotation change

Open zmeid opened this issue 5 years ago • 1 comments

How does the activity respond when the user rotates the screen?

When the screen is rotated, the current instance of activity is destroyed a new instance of the Activity is created in the new orientation. The onRestart() method is invoked first when a screen is rotated. The other lifecycle methods get invoked in the similar flow as they were when the activity was first created.

When rotation changes;

onPause()->OnStop()->OnDestroy->OnCreate()->onStart()->OnResume()

zmeid avatar Aug 07 '19 05:08 zmeid

onStart()->onRestoreInstanceState()->onResume()

saketp18 avatar Aug 10 '19 21:08 saketp18