public abstract class AdapterSavedState extends Object implements Parcelable
View.BaseSavedState for views. This saved
state class should be used to implement saved states for all adapters that inherit from the adapter
classes from the Widget Adapters library.Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>| Modifier and Type | Field and Description |
|---|---|
static Parcelable.Creator<AdapterSavedState> |
CREATOR
Creator used to create an instance or array of instances of AdapterSavedState from
Parcel. |
static AdapterSavedState |
EMPTY_STATE
Empty state that should be used as return value for
Adapter#saveInstanceState()
whenever that specific adapter does not need to save its state. |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE| Modifier | Constructor and Description |
|---|---|
protected |
AdapterSavedState(Parcel source)
Should be called from a
CREATOR of a derived class to create an instance of
AdapterSavedState with super state from the given parcel source. |
protected |
AdapterSavedState(Parcelable superState)
Should be called by a derived adapter classes when creating theirs SavedState objects to allow
chaining of those states via
Adapter#saveInstanceState(). |
| Modifier and Type | Method and Description |
|---|---|
int |
describeContents() |
Parcelable |
getSuperState()
Returns the super state of this saved state.
|
void |
writeToParcel(Parcel dest,
int flags) |
public static final AdapterSavedState EMPTY_STATE
Adapter#saveInstanceState()
whenever that specific adapter does not need to save its state.public static final Parcelable.Creator<AdapterSavedState> CREATOR
Parcel.protected AdapterSavedState(@NonNull Parcelable superState)
Adapter#saveInstanceState().superState - The state of the super class of the associated adapter.public void writeToParcel(@NonNull Parcel dest, int flags)
writeToParcel in interface Parcelable@NonNull public final Parcelable getSuperState()
AdapterSavedState(Parcelable) or a restored one via
AdapterSavedState(Parcel).public int describeContents()
describeContents in interface Parcelable