비디오

Best practices for saving UI state on Android

Google for Developers2023년 5월 10일

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 → https://goo.gle/438zaus Save UI state in Compose → https://goo.gle/3KwbwQb Speaker: Manuel Vicente Vivo Watch more: Watch all Android and Play Sessions → https://goo.gle/IO23_android_play Watch all the Technical Sessions from Google I/O 2023 → https://goo.gle/IO23_sessions Watch more Mobile Sessions → https://goo.gle/IO23_mobile All Google I/O 2023 Sessions → https://goo.gle/IO23_all Subscribe to Android Developers → https://goo.gle/AndroidDevs #GoogleIO #Featured #AndroidDevelopers #foundation