Well, thatβs what I found out (this is very strange).
If you need to update elements in the PagerAdapter , you probably will not be able to do this by creating new instances of PageAdapter when you pass the same FragmentManager and pass them to the setAdapter call to the ViewPager , for example:
FragmentManager fm = getChildFragmentManager(); mViewPager.setAdapter(new MyPagerAdapter(fm));
or
FragmentManager fm = getActivity().getSupportFragmentManager(); mViewPager.setAdapter(new MyPagerAdapter(fm));
But if you keep switching the FragmentManager when you initialize the PagerAdapter , then it will work.
From my point of view, this is terrible ... If someone has ideas on how to correctly edit elements in ViewPager (and not in this dirty form), share your thoughts with others :)
Toochka
source share