Enables pluggable components that save UI state across process death and restore it on restart, offering simple dependency setup and a concise API for state persistence.
Write pluggable components that save the UI state when a process dies, and restore it when the process restarts.
To add a dependency on Savedstate, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.
Add the dependencies for the artifacts you need in the build.gradle file for your app or module:
dependencies {
// Java language implementation
implementation("androidx.savedstate:savedstate:1.4.0")
// Kotlin
implementation("androidx.savedstate:savedstate-ktx:1.4.0")
}
dependencies {
// Java language implementation
implementation "androidx.savedstate:savedstate:1.4.0"
// Kotlin
implementation "androidx.savedstate:savedstate-ktx:1.4.0"
}
For more information about dependencies, see Add build dependencies.
Write pluggable components that save the UI state when a process dies, and restore it when the process restarts.
To add a dependency on Savedstate, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.
Add the dependencies for the artifacts you need in the build.gradle file for your app or module:
dependencies {
// Java language implementation
implementation("androidx.savedstate:savedstate:1.4.0")
// Kotlin
implementation("androidx.savedstate:savedstate-ktx:1.4.0")
}
dependencies {
// Java language implementation
implementation "androidx.savedstate:savedstate:1.4.0"
// Kotlin
implementation "androidx.savedstate:savedstate-ktx:1.4.0"
}
For more information about dependencies, see Add build dependencies.