Answer the question
In order to leave comments, you need to log in
What is the lifecycle of a fragment in a fragment?
Hello! I have a fragment that hosts fragments (let's call them sub-fragments). The network is full of examples of how to work with callbacks from a fragment in an activity ( https://developer.android.com/guide/components/fra... There, in onAttach, a listener is made from an activity, in onDetach we make a listener = null. This is all clear.
But I need to make the listener not from the activity, but from the parent fragment.Therefore, the question is: at what stages of the fragment life cycle is it correct to refer to the parent fragment? Also in onAttach / onDetach?
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question