0

I have this structure

Tabs with fragments

---(one)Fragment with ViewPager2

------- Fragments inside ViewPager2

When I change between ViewPager's fragments, onResume and onPause are called just fine.

Problem comes when I click on another tab to load another fragment. When I do that for some reason the fragment that hosts the ViewPager will receive onHiddenChanged callback but its children will not receive any callback.

I've tried all 3 constructors for FragmentStateAdapter, none of them helped and I have no idea how I will notify viewpager's fragments for such a lifecycle change. Any ideas?

0 Answers0