Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

StatefulAdapter

interface StatefulAdapter
androidx.viewpager2.adapter.StatefulAdapter

ViewPager2 adapters should implement this interface to be called during View#onSaveInstanceState() and View#onRestoreInstanceState(Parcelable)

Summary

Public methods
abstract Unit
restoreState(@NonNull savedState: Parcelable)

Restores adapter state

abstract Parcelable

Saves adapter state

Public methods

restoreState

abstract fun restoreState(@NonNull savedState: Parcelable): Unit

Restores adapter state

saveState

@NonNull abstract fun saveState(): Parcelable

Saves adapter state