1
  1. Activity 1 created and shown (portrait mode)
  2. Activity 2 created and shown (portrait mode)
  3. Rotation (to landscape mode). Activity 2 is recreated as expected
  4. Press Back
  5. Activity 1 is shown in portrait mode (landscape mode is expected with Activity 1 recreation)

Why activity is not recreated?

PS. No orientation set or onConfigurationChanged() overriden for Activity 1 in AndroidManifest.xml

4ntoine
  • 19,816
  • 21
  • 96
  • 220

2 Answers2

0

If you are having this code in manifest for activity1

add this code:android:screenOrientation="fullSensor"

if you have handled it in config changes:android:configChanges="orientation" then either remove it or you have it handle in onConfigurationChanged () callback in your activity

peeyush pathak
  • 3,663
  • 3
  • 19
  • 25
0

For some reason my colleague added activity.setRequestedOrientation(..) long time ago and it prevented activity from changing orientation.

4ntoine
  • 19,816
  • 21
  • 96
  • 220