RecyclerView.Adapter.StateRestorationPolicy
public
static
final
enum
RecyclerView.Adapter.StateRestorationPolicy
extends Enum<RecyclerView.Adapter.StateRestorationPolicy>
java.lang.Object | ||
↳ | java.lang.Enum<androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy> | |
↳ | androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy |
Defines how this Adapter wants to restore its state after a view reconstruction (e.g. configuration change).
Summary
Enum values | |
---|---|
RecyclerView.Adapter.StateRestorationPolicy |
ALLOW
Adapter is ready to restore State immediately, RecyclerView will provide the state to the LayoutManager in the next layout pass. |
RecyclerView.Adapter.StateRestorationPolicy |
PREVENT
RecyclerView will not restore the state for the Adapter until a call to
|
RecyclerView.Adapter.StateRestorationPolicy |
PREVENT_WHEN_EMPTY
Adapter is ready to restore State when it has more than 0 items. |
Public methods | |
---|---|
static
RecyclerView.Adapter.StateRestorationPolicy
|
valueOf(String name)
|
static
final
StateRestorationPolicy[]
|
values()
|
Inherited methods | |
---|---|
Enum values
ALLOW
public static final RecyclerView.Adapter.StateRestorationPolicy ALLOW
Adapter is ready to restore State immediately, RecyclerView will provide the state to the LayoutManager in the next layout pass.
PREVENT
public static final RecyclerView.Adapter.StateRestorationPolicy PREVENT
RecyclerView will not restore the state for the Adapter until a call to
RecyclerView.Adapter.setStateRestorationPolicy(StateRestorationPolicy)
is made with either
ALLOW
or PREVENT_WHEN_EMPTY
.
PREVENT_WHEN_EMPTY
public static final RecyclerView.Adapter.StateRestorationPolicy PREVENT_WHEN_EMPTY
Adapter is ready to restore State when it has more than 0 items. RecyclerView will provide the state to the LayoutManager as soon as the Adapter has 1 or more items.
Public methods
valueOf
public static RecyclerView.Adapter.StateRestorationPolicy valueOf (String name)
Parameters | |
---|---|
name |
String |
Returns | |
---|---|
RecyclerView.Adapter.StateRestorationPolicy |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-04-15 UTC.