Fix issue with sort not working after rotating device
This commit is contained in:
parent
8ab9448f54
commit
68de0e8d79
|
@ -15,8 +15,14 @@ class ViewPagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) {
|
|||
private val fragments = HashMap<Int, Fragment>()
|
||||
|
||||
override fun getItem(position: Int): Fragment {
|
||||
val fragment = getFragment(position)
|
||||
fragments[position] = fragment
|
||||
return getFragment(position)
|
||||
}
|
||||
|
||||
override fun instantiateItem(container: ViewGroup, position: Int): Any {
|
||||
val fragment = super.instantiateItem(container, position)
|
||||
if (fragment is Fragment) {
|
||||
fragments[position] = fragment
|
||||
}
|
||||
return fragment
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue