Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

StateRestorationPolicy

class StateRestorationPolicy
kotlin.Any
   ↳ kotlin.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

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

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

Adapter is ready to restore State when it has more than 0 items.

Enum values

ALLOW

enum val ALLOW : RecyclerView.Adapter.StateRestorationPolicy

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

PREVENT

enum val PREVENT : RecyclerView.Adapter.StateRestorationPolicy

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

PREVENT_WHEN_EMPTY

enum val PREVENT_WHEN_EMPTY : RecyclerView.Adapter.StateRestorationPolicy

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.