Why doesn't the emulator behave correctly on orientation change?
android, java, screen-orientation
Solution
I think I know the answer. I have the same problem using the emulator for Pixel 2, API level 28, on Android Studio 3.4.1 (the latest as of writing this).
How I fixed this was by dragging the Quick Settings drop-down menu on the emulator (click and drag from the top right corner of the emulator's screen), and ensuring that auto-rotation was enabled.
When I checked, it wasn't, so I enabled it. After enabling it, the emulator worked normally :).
Hope this helped!
Problem
As far as I know, by default, when device is rotated, the current activity is destroyed and recreated. I'm rotating the emulator using LeftCTRL+F12 but it's not destroyed. I have logs in `OnDestroy`, `OnCreate` and `OnStart` and `OnResume`, but none of those fire up when I rotate the device. Before: After: AndroidManifest.xml: ``` <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.geo_quiz" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.geo_quiz.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> ```