Where is getChildFragmentManager in support library v13?

Greg Ennis picture Greg Ennis · Feb 19, 2014 · Viewed 8.1k times · Source

Android support library v13 is supposed to provide support for newer APIs from Android 3.1. However, as far as I can tell there is no support for child fragments. Specifically, where is getChildFragmentManager()? The v13 support library relies on native fragments, which didn't add this method until API level 17. I have an app with minimum SDK level 14 so I should be able to use the v13 support library, but it seems I can't.

I don't want to go all the way back to the v4 support library and take on all it's weight. The v13 library is perfect otherwise.

Answer

midnightstar picture midnightstar · Oct 7, 2014

If you want to use nested fragments within a native Fragment. use getFragmentManager().

If you want to use nested fragments within a support library Fragment, use getChildFragmentManager().

Just found this out by accident. It works. :)