activity和fragment生命周期对比
来源:互联网 发布:淘宝卖家花呗支付 编辑:程序博客网 时间:2024/05/21 22:43
一,activity生命周期
二,fragment生命周期
场景演示 : 切换到该Fragment
11-29 14:26:35.095: D/AppListFragment(7649): onAttach
11-29 14:26:35.095: D/AppListFragment(7649): onCreate
11-29 14:26:35.095: D/AppListFragment(7649): onCreateView
11-29 14:26:35.100: D/AppListFragment(7649): onActivityCreated
11-29 14:26:35.120: D/AppListFragment(7649): onStart
11-29 14:26:35.120: D/AppListFragment(7649): onResume
屏幕灭掉:
11-29 14:27:35.185: D/AppListFragment(7649): onPause
11-29 14:27:35.205: D/AppListFragment(7649): onSaveInstanceState
11-29 14:27:35.205: D/AppListFragment(7649): onStop
屏幕解锁
11-29 14:33:13.240: D/AppListFragment(7649): onStart
11-29 14:33:13.275: D/AppListFragment(7649): onResume
切换到其他Fragment:
11-29 14:33:33.655: D/AppListFragment(7649): onPause
11-29 14:33:33.655: D/AppListFragment(7649): onStop
11-29 14:33:33.660: D/AppListFragment(7649): onDestroyView
切换回本身的Fragment:
11-29 14:33:55.820: D/AppListFragment(7649): onCreateView
11-29 14:33:55.825: D/AppListFragment(7649): onActivityCreated
11-29 14:33:55.825: D/AppListFragment(7649): onStart
11-29 14:33:55.825: D/AppListFragment(7649): onResume
回到桌面
11-29 14:34:26.590: D/AppListFragment(7649): onPause
11-29 14:34:26.880: D/AppListFragment(7649): onSaveInstanceState
11-29 14:34:26.880: D/AppListFragment(7649): onStop
回到应用
11-29 14:36:51.940: D/AppListFragment(7649): onStart
11-29 14:36:51.940: D/AppListFragment(7649): onResume
退出应用
11-29 14:37:03.020: D/AppListFragment(7649): onPause
11-29 14:37:03.155: D/AppListFragment(7649): onStop
11-29 14:37:03.155: D/AppListFragment(7649): onDestroyView
11-29 14:37:03.165: D/AppListFragment(7649): onDestroy
11-29 14:37:03.165: D/AppListFragment(7649): onDetach
比Activity多了一些生命周期,完整和Activity对接上,大家好好利用。
三,与Activity生命周期的对比
- Activity和Fragment生命周期对比
- activity和fragment生命周期对比
- Fragment、Activity生命周期对比
- Activity和Fragment的生命周期,以及对比
- Fragment的生命周期和Activity生命周期对比 代码片段
- Fragment 与 Activity 生命周期对比
- Fragment及Activity生命周期对比
- Activity与Fragment生命周期对比
- Android开发之Activity和Fragment生命周期对比图
- activity和fragment生命周期
- Fragment和Activity生命周期
- Activity和Fragment生命周期
- Activity和Fragment生命周期
- activity和fragment生命周期
- Activity和Fragment生命周期
- Activity和Fragment生命周期
- fragment和activity生命周期
- activity和fragment生命周期
- 【Storm总结-2】关于Storm 中Topology的并发度的理解
- 由open()的O_DIRECT参数引发的公共标准的问题
- C++写的UrlEncode和UrlDecode
- 安卓训练-开始-支持不同的设备-支持不同的屏幕
- Java Bitmap操作详解
- activity和fragment生命周期对比
- IOS 文件目录及NSUserDefaults浅谈
- 解决android调试logcat 无 application信息问题
- 使用FREEMARKER的一些总结
- Having problem building jcifs V1.2.19
- 解决Godaddy付款时的There was a problem processing your transaction. Please verify your payment information
- 皎月的出装方法
- hadoop安全模式
- 【Storm总结-3】Storm如何保证消息不丢失 (Guaranteeing-message-processing)