ViewPager is nested in ViewPager and fills data with Fragment, but after switching the outer ViewPager, there is no way to load the data in the inner ViewPager. For example: when I switch to the home page and then return to the home page, the data in it cannot be loaded.
Solution:
adapter = new TabAdapter(getFragmentManager(), consName, mConsFragments);
adapter = new TabAdapter(getChildFragmentManager(), consName, mConsFragments);
just change getFragmentManager() to getChildFragmentManager().
Analysis:
getFragmentManager is to the Manager of the fragment contained in the activity, and if it is a fragment nested fragment, then you need to use getChildFragmentManager().
getFragmentManager() is the fragment management of the parent container of the fragment, and
getChildFragmentManager() is the fragment management of the child container in the fragment.