Starting Android 4.2, Android supports nested Fragments. The doc doesn\'t give a lot of explanations regarding nested Fragment
lifecycles but from experience, it ap
I don't think you can in onCreate
as the view isn't constructed at that time. You can in onViewCreated()
though. The logic I used is:
onViewCreated()
, if there is, try to get the child fragmentBy "checking" I mean looking up the fragment by id. I guess by tag should work too.
AFAIK you can't get a child fragment before the view hierarchy is restored or created, but you could do the same at later time, for example in onActivityCreated()