Exactly when is onAttach
called during the Fragment-Activity lifecycles?
I am aware of the Fragment Life-Cycle but exactly when?
Is it when the fragment object is initiated or when fragment manager is called?
Exactly when is onAttach
called during the Fragment-Activity lifecycles?
I am aware of the Fragment Life-Cycle but exactly when?
Is it when the fragment object is initiated or when fragment manager is called?
In activity the first method is onCreate. onCreate of activity add the fragment and in this moment onAttach is called. like in the picture
onAttach is called after Fragment is associated with its Activity.
http://developer.android.com/reference/android/app/Fragment.html#onAttach(android.content.Context)