Android getChildFragmentManager() level API < 17

后端 未结 2 1248
小鲜肉
小鲜肉 2020-12-11 15:49

I am trying to use getChildFragmentManager() method on api 14, but of course I am getting error. Is there anyway to use this method on lower apis. Thanks

相关标签:
2条回答
  • To someone that appeared here by a search on Google

    I was having a similar problem using DialogFragment

    The problem was because I was importing android.app.DialogFragment instead of android.support.v4.app.DialogFragment

    DialogFragment or not, be sure that you are importing the right libs :)

    0 讨论(0)
  • 2020-12-11 16:16

    To use nested fragments on API Level 16 and below, you need to use the fragments backport from the support-v4 or support-v13 portion of the Android Support package. This, in turn, requires you to inherit from FragmentActivity and have your fragments inherit from android.support.v4.app.Fragment. Then, you can call getChildFragmentManager() to use nested fragments.

    0 讨论(0)
提交回复
热议问题