Fragment no longer exists for key FragmentStateAdapter with Viewpager2
Using viewpager2 with FragmentStateAdapter
has a similar behaviour than FragmentStatePagerAdapter
Actually there are two ways of solving this problem
First one is seting setSaveEnabled()
to false into our viewpager2
viewpager2.setSaveEnabled(false)
The other one is overriding restoreState
at our adapter and return null
Check : https://developer.android.com/reference/androidx/viewpager2/adapter/FragmentStateAdapter