ViewPager carousel using PageContainer not working with FragmentPagerAdapter

I use https://gist.github.com/8cbe094bb7a783e37ad1 to display multiple pages of ViewPager at once. It works fine with a simple PageAdapter, but I need to display a large number of bitmap images. So I read http://developer.android.com/training/displaying-bitmaps/index.html and it says:

You can implement this template using the ViewPager component supported by the PagerAdapter. However, a more suitable support adapter is the subclass FragmentStatePagerAdapter , which automatically destroys and saves the state of fragments in the ViewPager when they disappear off the screen, saving memory usage.

I tried to create a new FragmentStatePagerAdapter, but it does not work:

E / AndroidRuntime (25400): android.content.res.Resources $ NotFoundException: Unable to find resource ID # 0xffffffff

I really don’t understand what the error is, because I do not use any specific resources except layouts.

Does anyone have an idea how to solve this?

+5
source share
2 answers

, , android: id ViewPager PageContainer. , , , , , .

- , .

+9

:

FragmentPagerAdapter ViewPager .

, , . , , , .

+4

All Articles