Closed aeroechelon closed 8 years ago
Any update on this? I'm seeing this same thing.
@tmmiller1982, I fixed this issue by constructing the corresponding adapter, FragmentStatePagerAdapter
with Fragment#getChildFragmentManager()
. If you have a fragment within a fragment you need to construct this new fragment with a child fragment manager so it can handle the Back navigation appropriately.
It took me a while to figure this one out ... it should be documented somewhere in the Android Docs since the ubiquitous use of Fragments
...
ah very nice. Good find!
Can you please show me the code how you change from FragmentPagerAdapter into FragmentStatePagerAdapter?
You can populate this ViewPager
with FragmentStatePagerAdapter
provided by the SDK here.
I'm seeing this issue too,but I use view instead of fragment,and sometimes the page is blank...Any suggestions?
Did anyone get a solution to this?
Kindly Help me guys, i have a simple image silder implementation with Viewpager and using PagerAdapter my VIewpager show sometimes empty.
Hello guys. I was having the same problem, then I noticed that I was creating multiple instances of my adapter, since it was being created and instantiated on OnViewCreated. To fix this I created a PagerAdapter global variable, then I instantiate the variable ONLY within OnCreateView. This fixed my issue of going back and creating new empty screens.
I'm having the same issue. it's more like google viewpager than this viewpager.
I've noticed that when you initialize a fragment with this ViewPager, navigate away then navigate 'Back'; an empty page is shown. After navigating back to this fragment, you can continue to swipe on the pager, then after X amount of items the view pager it against populated with more items.
Initializing a fragment with this ViewPager seems to work fine; however, coming back to a fragment that had already been created creates some blank pages.