片段生命周期中是否在onAttach上调用? [英] When is onAttach called during the Fragment LifeCycle?
问题描述
在Fragment-Activity生命周期中,是否 onAttach
被调用?
我知道碎片生命周期但确切时间到了什么时候?
是否碎片对象是启动或何时调用片段管理器?
在活动中,第一种方法是onCreate。
onCreate of activity添加片段,此时onAttach被调用。如图中
参考:
参考: https://github.com/xxv/android-lifecycle
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
Ref: http://baiduhix.blogspot.com.br/2015/08/android-how-to-do-findviewbyid-in.html
EDIT:
updated lifecycle of Android
Ref: https://github.com/xxv/android-lifecycle
这篇关于片段生命周期中是否在onAttach上调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!