codelab-android-lifecycles icon indicating copy to clipboard operation
codelab-android-lifecycles copied to clipboard

Rotating screen does not reset timer

Open ocarlsen opened this issue 3 years ago • 0 comments

The codelab for Step 1 says that rotating the phone resets the timer:

Rotate the screen and notice that the timer resets!

However, it does not. This is because the onCreate method does not get called on rotation. Same with Step 2. Seems you need to add this to the activity in the manifest:

android:screenOrientation="fullSensor"

Android Studio Bumblebee | 2021.1.1 Patch 2 Build #AI-211.7628.21.2111.8193401, built on February 16, 2022 Runtime version: 11.0.11+0-b60-7590822 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 12.3 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 8 Registry: external.system.auto.import.disabled=true Non-Bundled Plugins: org.intellij.plugins.markdown (211.7142.37)

ocarlsen avatar Apr 03 '22 20:04 ocarlsen