1

When there is a need to use getSupportFragmentManager() to support lower API levels, I think using getChildFragmentManager() method. How this method supports all API levels?

Blo
  • 11,903
  • 5
  • 45
  • 99
saravanan
  • 5,339
  • 7
  • 45
  • 52

1 Answers1

2

They are both in the support library.

Greg Ennis
  • 14,917
  • 2
  • 69
  • 74
  • 1
    I have another question . both getSupportFragmentManager() and getChildFragmentManager() returns android.support.v4.app.FragmentMamager . why there is no seperate FragementManager for child. – saravanan Dec 31 '13 at 03:40
  • Apparently they made a design decision to use the same class. It must operate a little bit differently when working with private child fragments, but it has the same public-facing methods so they just used the same class. – Greg Ennis Dec 31 '13 at 03:46
  • 1
    But if I use the support library, then all `Fragment` are also forced to be support library's one. It makes no sense for new devices. Is there some smart way to avoid need to modify all `Fragment` importing? – Romulus Urakagi Ts'ai Aug 27 '14 at 09:47