public enum

RecyclerView.Adapter.StateRestorationPolicy

extends java.lang.Enum<RecyclerView.Adapter.StateRestorationPolicy>

 java.lang.Object

↳java.lang.Enum<RecyclerView.Adapter.StateRestorationPolicy>

↳androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy

Overview

Defines how this Adapter wants to restore its state after a view reconstruction (e.g. configuration change).

Summary

Enum Constants
ALLOWAdapter is ready to restore State immediately, RecyclerView will provide the state to the LayoutManager in the next layout pass.
PREVENTRecyclerView will not restore the state for the Adapter until a call to RecyclerView.Adapter.setStateRestorationPolicy(RecyclerView.Adapter.StateRestorationPolicy) is made with either RecyclerView.Adapter.StateRestorationPolicy.ALLOW or RecyclerView.Adapter.StateRestorationPolicy.PREVENT_WHEN_EMPTY.
PREVENT_WHEN_EMPTYAdapter is ready to restore State when it has more than 0 items.
Methods
public static RecyclerView.Adapter.StateRestorationPolicyvalueOf(java.lang.String name)

public static RecyclerView.Adapter.StateRestorationPolicyvalues()

from java.lang.Enum<E>clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
from java.lang.ObjectgetClass, notify, notifyAll, wait, wait, wait

Enum Constants

ALLOW

Adapter is ready to restore State immediately, RecyclerView will provide the state to the LayoutManager in the next layout pass.

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.

PREVENT

RecyclerView will not restore the state for the Adapter until a call to RecyclerView.Adapter.setStateRestorationPolicy(RecyclerView.Adapter.StateRestorationPolicy) is made with either RecyclerView.Adapter.StateRestorationPolicy.ALLOW or RecyclerView.Adapter.StateRestorationPolicy.PREVENT_WHEN_EMPTY.

Methods

public static RecyclerView.Adapter.StateRestorationPolicy valueOf(java.lang.String name)