onSaveInstanceState调用时机以及fragment commit的时机

1.一个activity跳到另一个activity

06-20 17:25:03.563 990-2448/? I/ActivityManager: START u0 {cmp=com.xiayu.androidservice/.SecondActivity} from pid 16611
06-20 17:25:03.723 16611-16611/com.xiayu.androidservice D/MainActivity: onPause: 
06-20 17:25:03.733 16611-16611/com.xiayu.androidservice D/SecondActivity: onCreate: 
06-20 17:25:03.853 990-1073/? I/ActivityManager: Displayed com.xiayu.androidservice/.SecondActivity: +127ms
06-20 17:25:04.183 16611-16611/com.xiayu.androidservice D/MainActivity: onSaveInstanceState() called with: outState = [Bundle[{android:viewHierarchyState=Bundle[{android:views=android.util.SparseArray@41f7b850}]}]]
06-20 17:25:04.183 16611-16611/com.xiayu.androidservice D/MainActivity: onStop: 

2.home 键

06-20 17:32:58.943 16611-16611/com.xiayu.androidservice D/MainActivity: onPause: 
06-20 17:32:59.523 16611-16611/com.xiayu.androidservice D/MainActivity: onSaveInstanceState() called with: outState = [Bundle[{android:viewHierarchyState=Bundle[{android:views=android.util.SparseArray@42014e80}]}]]
06-20 17:32:59.523 16611-16611/com.xiayu.androidservice D/MainActivity: onStop: 

3.真正被kill掉



4.横竖屏



https://blog.piasy.com/2015/10/01/APP-Launch-Accelerate/

http://blog.jobbole.com/66117/

http://www.jianshu.com/p/d9143a92ad94

http://www.cnblogs.com/huihuizhang/p/6089069.html

setRetainInstance

你可能感兴趣的:(android,java)