I know it sounds like a duplicate of FragmentStatePagerAdapter IllegalStateException: is not currently in the FragmentManager but his solution isn\'t relevan
If your ViewPager is layouted inside a fragment (not an activty) : mViewPager.setAdapter(new MyFragmentStatePagerAdapter(getChildFragmentManager()));
mViewPager.setAdapter(new MyFragmentStatePagerAdapter(getChildFragmentManager()));