AutoScrollViewPager icon indicating copy to clipboard operation
AutoScrollViewPager copied to clipboard

UseFragmentStatePagerAdapter instead of PagerAdapter

Open Jugalkishorocs opened this issue 6 years ago • 1 comments

If i use FragmentStatePager adapter image not loading and if i use PagerAdapter Image Correctly loaded ! what will be issue on my side?

Jugalkishorocs avatar Nov 02 '18 06:11 Jugalkishorocs

If i use FragmentStatePager adapter image not loading and if i use PagerAdapter Image Correctly loaded ! what will be issue on my side?

No. it's not your problem.

Infinite scrollable ViewPager wraps user's adapter with a new adapter, which returns a larger count in getCount, and maps the wrapper adapter's[the new adapter] item to the wrapped adapter's[user's adapter] item. As a result, in the wrapper adapter, multiple items will be mapped to the same item in the wrapped adapter.

Because FragmentStatePagerAdapter caches fragments, and a fragment can't be added multi times, FragmentStatePagerAdapter can't be used in this case.

angeldevil avatar Nov 20 '18 07:11 angeldevil