ViewPager2, FragmentStateAdapter, and conflict between pager's currentItem and adapter's createFragment's position parameter
When implementing ViewPager2 and its associated FragmentStateAdapter for its contents in Kotlin, I ran into a weird issue: It has to do with the adapter's createFragment(position: Int) method and viewPager2's setCurrentItem(item: Int, smoothScroll: Boolean). Currently, implementing this for an adapter of size 2 items is fine, being able to start from position 0 of the view pager and able to change items as intended.
The issue then comes from attempting to set the viewPager's currentItem value...