ViewPager - onCreateView is not always called

Bakus123 picture Bakus123 · Aug 29, 2014 · Viewed 11.4k times · Source

I have a ViewPager with 10 pages. When I start the last (10th) page onCreateView() method of my fragment is called. When I swipe to the 9th page onCreateView() is called also. But when I back to the 10th page onCreateView() isn't called. What's wrong?

Answer

Vinay picture Vinay · Apr 7, 2017

Try Extending FragmentStatePagerAdapter