Search code examples
androidandroid-fragmentsandroid-viewpager

ViewPager blank on back from another fragment


Actually, I am using whole application in a single activity by fragments in main view container. One fragment contains a viewPager when I clicked over a header button fragment replaced by LoginFragment and on Back we maintaining backstack so fragment containing viewPager will be on top but there we got blank view of current item in viewPager.


Solution

  • I got an answer by my self on debugging. Problem was I was using fragmentPager inside fragment so there for adapter initialization we have to pass getChildFragmentManager() instead of getFragmentManager()