onSaveInstanceState

@Nullable
open fun onSaveInstanceState(@NonNull parent: @NonNull CoordinatorLayout, @NonNull child: @NonNull V): @Nullable Parcelable(source)

Hook allowing a behavior to generate a representation of its internal state that can later be used to create a new instance with that same state. This state should only contain information that is not persistent or can not be reconstructed later.

Behavior state is only saved when both the parent CoordinatorLayout and a view using this behavior have valid IDs set.

Return

Returns a Parcelable object containing the behavior's current dynamic state.

Parameters

parent

the parent CoordinatorLayout

child

child view to restore from

See also