Cannot get rotation to fire onDestroy()

On my desktop computer I have no problem with this. I installed Dolphin about a month ago.
On my laptop, I was having issues with logcat, so I upgraded to Electric Eel. Now, when I rotate or use the back button the state persists when it shouldn’t. onDestroy is not called.

1 Like

Electric Eel switched out the old Logcat for a new one (see: Android Studio Electric Eel | 2022.1.1  |  Android Developers). With this new Logcat, try removing the process:mine text in the search bar and see if you can find your onDestroy() log. On newer versions of Android, Logcat sometimes loses track of what process (or app) is running and with that Locgcat would accidentally filter that log out.

That isn’t the issue. The state actually persists through rotation or the back button. I go to question 2, rotate, and question 2 is STILL there. To be clear, I am in in the beginning of chapter 4, and have not fixed the error with a ViewModel yet. I just uninstalled Electric Eel, and downloaded it again, and there is no change.

Weird. And just so we are on the same page, your emulator is actually rotating when you press the rotate button? You should see a landscape layout for GeoQuiz.

I did personally have an issue where the emulator was unresponsive after rotating it. It has been fixed in beta versions of Android Studio, but you can get a temporary workaround by having it open in a separate window (See: Android Studio Emulator in a Separate Window - Stack Overflow).

When I updated, I hade to uninstall and reinstall. I lost the auto-rotate setting and just forgot about it. Had to go back to page 54 for the answer. Issue resolved!