windowIsTranslucent属性对activity生命周期的影响

<item name="android:windowIsTranslucent">true</item>:是否半透明

activity A跳转到 activity B ,B的 windowIsTranslucent这个属性设置为true后,

A的生命周期 只能走到onPause, 不会走到onStop.

windowIsTranslucent这个属性相当于把B变成一个dialog了,A跳转到B,相当于在A上面悬浮了一个窗口,所以A没有Stop

------------A_onCreate--------------
------------A_onResume--------------
------------A_onPause--------------
------------B_onCreate--------------
------------B_onResume--------------

猜你喜欢

转载自blog.csdn.net/hpp_1225/article/details/83306849