android/codelab-android-lifecycles

Rotating screen does not reset timer

ocarlsen opened this issue · 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)