我正在经历这 <item name="android:windowIsTranslucent">true</item>正在改变 Android Lifecycle 的处理方式。我想这样做是因为如果窗口是半透明的,您仍然可以看到底层活动。我们称之为活动 A。
让我们看一下下面的示例,其中我们在活动 A 之上有另一个活动。这个其他活动称为 B。
Activity A Started - This activity is the first activity
Activity A Stopped - Now you start activity B.
Activity B Started - This activity has windowIsTranslucent set to false. Hence we can't see anything of activity A anymore which is why activity A stopped.
Now hit the power button to go into lockscreen mode.
Activity B Stopped - Since none is visible anymore activity B also stops. …Run Code Online (Sandbox Code Playgroud) android transparent lockscreen android-lifecycle android-activity