Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

Savedstate

Version 1.0.0-alpha02

March 13th, 2019

androidx.savedstate:savedstate:1.0.0-alpha02 is released. androidx.savedstate:savedstate combines artifacts androidx.savedstate:savedstate-bundle and androidx.savedstate:savedstate-common into one artifact, because it was decided to simplify savedstate infrastructure and remove generics from SavedStateRegistry. Thus, there is no need for separate modules.

The full list of commits included in this version can be found here.

New features

  • SavedStateRegistry.runOnNextRecreaction(Class<? extends AutoRecreated> clazz ) was added. The given class will be instantiated and the method AutoRecreated.onRecreated will be run when the owning component restarted.

API changes

  • Generics removed from SavedStateRegistry<T>
  • AbstractSavedStateRegistry & BundlableSavedStateRegistry are removed, use simple SavedStateRegistry instead
  • BundleSavedStateRegistryOwner is renamed to SavedStateRegistryOwner

Version 1.0.0-alpha01

December 17, 2018

This is the first release of SavedState.

New features

androidx.savedstate is a new set of alpha APIs that allow developers to plugin components to the restore / saveInstanceState process. The main entry point of the API is SavedStateRegistry<T>, which provides a way to retrieve previously savedstate via consumeRestoredStateForKey and register a callback to registerSavedStateProvider to provide a savedstate once system requests it.