Jetpack Saved State for ViewModel: Getting Started

In this tutorial, you’ll learn how to used the Saved State library from Android Jetpack to preserve the UI state of an Android application. By Ishan Khanna.

Leave a rating/review
Download materials
Save for later
Share
You are currently viewing page 3 of 3 of this article. Click here to view the first page.

Identifying Candidates for Using Saved State

With great power, comes great responsibility. You’ve learned a neat way to persist data for UI state, but you shouldn’t use it everywhere. Sometimes a Room Database or SharedPreferences might work better.

Before you use the SavedStateHandle, ask yourself if it is something you need. They are not a replacement for SharedPreferences or any other modes of data persistence mechanisms.

Where to Go From Here?

You can download the completed project by clicking the Download Materials button at the top or bottom of this tutorial.

ADB has other cool features you should be familiar with. If you’d like to read more about ADB, checkout the Official Google Documentation.

Want to learn more about saving UI states? This article from Google is a great place to start.

I hope you enjoyed this tutorial. If you have any questions or comments, please join the forum below!