Unable to adjust the screen upon rotation

When I am testing the application in a simulator, upon turning the cell phone right or left the screen stays as it is and does not adjust to the rotation. I have the newest Android Studio installed. Has anybody made a similar observation?

Make sure that screen rotation is allowed by the device. When in portrait mode, drag down from the top to pull the top window shade down. There should be an icon that looks like a phone with two rotating arrows, make sure that is enabled and lit.

Alternatively, if that is not set then with some devices when in landscape mode there appears the rotate arrows by the “back, home, recents” buttons. Click that to rotate the UI.

Thank you for your answer. I resolved the problem the way you described. Screen rotation was always working before. But somehow, when I was learning Kotlin and after some break used Android Studio again, it had stopped.