1

I think I've come across the bug of FragmentStatePagerAdapter as below:

https://issuetracker.google.com/issues/36956111

I've tried many solutions I found on the web but they didn't work well.

Just want to ask if you guys have any solutions on that when using FragmentStatePagerAdapter?

(Returning POSITION_NONE unconditionally in getItemPosition() works, but I don't want to recreate the current and off-screen fragments unconditionally every time notifyDatasetChanged() is called)

im_chc
  • 1,023
  • 15
  • 24
  • The reason this works is because FragmentStatePagerAdapter destroys as Fragments that aren't being used. FragmentPagerAdapter does not. – Hemant Parmar Jan 03 '18 at 11:12
  • I mean, those loaded fragments, including the current item and the off-screen pages, would be recreated when position_none is returned unconditionally – im_chc Jan 03 '18 at 11:52

0 Answers0