Viewpager2 With Fragments
Just a note to my future me, since I saw a weird behavior of ViewPager2 together with a TabLayout and a FragmentStateAdapter.
The default behavior seems to be, not to “warm up” the next fragments. To achieve this, set:
yourViewPager.offscreenPageLimit = 1
You can of course set higher numbers, which will cause more fragments to be preloaded.