Best practices for saving UI state on Android

39 848
16.8
Опубликовано 10 мая 2023, 20:39
Saving a UI state properly is essential for providing a great UX experience. Your users might be disappointed if your screen doesn't preserve its state during a configuration change, activity recreation, or system-initiated process death. Learn best practices to save UI state properly in both the View system and Jetpack Compose by comparing APIs such as remember, rememberSaveable, onSaveInstanceState, ViewModel, and SavedStateHandle.

Chapters:
0:00 - Introduction
0:41 - Losing app state
2:10 - ViewModel
4:08 - Persistent storage
5:35 - Saved State APIs
8:45 - Testing saved state APIs
9:29 - SavedStateHandle
10:49 - Contribute to saved state from your own classes
14:33 - Control rememberSaveable value's lifecycle
19:00 - Recap

Resources:
Saving UI state on Android docs → goo.gle/438zaus
Save UI state in Compose → goo.gle/3KwbwQb

Speaker: Manuel Vicente Vivo

Watch more:
Watch all Android and Play Sessions → goo.gle/IO23_android_play
Watch all the Technical Sessions from Google I/O 2023 → goo.gle/IO23_sessions
Watch more Mobile Sessions → goo.gle/IO23_mobile
All Google I/O 2023 Sessions → goo.gle/IO23_all

Subscribe to Android Developers → goo.gle/AndroidDevs

#GoogleIO #Featured #AndroidDevelopers #foundation
автотехномузыкадетское