0

How would I use android.app.Fragment; inside FragmentStatePagerAdapter

It only supports returning: android.support.v4.app.Fragment. An existing fragment I am using inherits from RxFragment which doesn't use the support library fragment.

Tim Nuwin
  • 2,775
  • 2
  • 29
  • 63
  • I ended up using: http://stackoverflow.com/questions/17553374/android-app-fragments-vs-android-support-v4-app-using-viewpager – Tim Nuwin Dec 28 '16 at 21:47

2 Answers2

3

You can't.

FragmentStatePagerAdapter and FragmentPagerAdapter are part of the support library, and only support the support Fragments.

If you really want to do this, you could copy the source for those classes and replace the support Fragment imports with framework Fragment imports.

Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
0

You can use android.app.Fragment if you use android.support.v13.app.FragmentStatePagerAdapter from the v13 Support Library. See this answer from @brillenheini

snark
  • 2,462
  • 3
  • 32
  • 63