0Pricing
Jetpack Compose Academy · Lesson

rememberSaveable Across Rotation

Keep state through configuration changes.

The Rotation Problem

Rotate the screen and your tap counter snaps back to zero. That is because a configuration change recreates the whole Activity.

remember Isn't Enough

remember survives recomposition, but not Activity recreation. When the Activity restarts, remembered state is gone for good.

All lessons in this course

  1. remember & mutableStateOf
  2. Recomposition: What Triggers a Redraw
  3. Build a Tap Counter
  4. rememberSaveable Across Rotation
← Back to Jetpack Compose Academy