是否可以将 android.app.Fragment 与 FragmentStatePagerAdapter 一起使用

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

如何在 FragmentStatePagerAdapter

中使用 android.app.Fragment;

只支持返回:android.support.v4.app.Fragment。我正在使用的现有片段继承自 RxFragment,它不使用支持库片段。

你不能。

FragmentStatePagerAdapterFragmentPagerAdapter是支持库的一部分,只支持支持Fragments。

如果你真的想这样做,你可以复制那些 类 的源代码并将支持片段导入替换为框架片段导入。

如果你使用来自@brillenheini

android.support.v13.app.FragmentStatePagerAdapter from the v13 Support Library. See this答案,你可以使用android.app.Fragment