Search code examples
androidandroid-fragmentsandroid-viewpagerandroid-support-library

Use both v4 Fragment and native Fragment in One ViewPager


Is there a way to use both v4 fragment and native fragment in same ViewPager? Any ideas helps.Thank you!


Solution

  • No. The framework Fragment and support library Fragment are managed by entirely different FragmentManagers, and it wouldn't be feasible to make a solution that can page through both while keeping the fragments' lifecycles intact. My suggestion would be to convert the framework Fragment to a support Fragment, which should take minimal effort.