A Bug In Viewpager Using It With Other Fragment
Solution 1:
Um no. A ViewPager extends ViewGroup. How does that make it a Fragment?
Yes, you're right that nesting Fragments isn't supported. However, it works if you have a Fragment holding a ViewPager whose Adapter contains several Fragments. Trust me, it works. I'm using it in the current project I'm working on right now and I've even got nested ViewPagers without the horizontal touch events fighting for control, so essentially I have Fragments within a Fragment.
Solution 2:
With revision 11 of the Android Support Library, you can now nest fragments within fragments to avoid the recursive exception. See this question How to add a Fragment inside a ViewPager using Nested Fragment (Android 4.2)
Solution 3:
A ViewPager is basically a Fragment, and you can't put Fragments in Fragments. Period.
Post a Comment for "A Bug In Viewpager Using It With Other Fragment"