你好,游客 登录 注册 搜索
背景:
阅读新闻

android fragment执行流程 -

[日期:2013-04-16] 来源:  作者: [字体: ]

1. onAttach ------called once the fragment is associated with its activity

2. onCreate-------called to do initial creation of the fragment

3. onCreateView---creates and returns the view hierarchy associated with the fragment

4.onActivityCreated ---tells the fragment that its activity has completed its own {@link Activity#onCreate Activity.onCreaate}

5.onStart----------makes the fragment visible to the user (based on its containing activity being started)

6.onResume-----makes the fragment interacting with the user (based on its containing activity being resumed).

7. onPause----- fragment is no longer interacting with the user either because its activity is being paused or a fragment operation is modifying it in the activity.

8.onStop------fragment is no longer visible to the user either  because its activity is being stopped or a fragment operation is modifying it  in the activity.

9.onDestroyView ------allows the fragment to clean up resources  associated with its View.

10.onDestroy---------called to do final cleanup of the fragment's state.

11.onDetach--------called immediately prior to the fragment no longer   being associated with its activity






收藏 推荐 打印 | 录入:admin | 阅读:
相关新闻