Tim Nuwin
Tim Nuwin

Reputation: 2887

Is it possible to use android.app.Fragment with FragmentStatePagerAdapter

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.

Upvotes: 0

Views: 497

Answers (2)

snark
snark

Reputation: 2897

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

Upvotes: 0

Bryan Herbst
Bryan Herbst

Reputation: 67259

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.

Upvotes: 3

Related Questions