假设这样一个情况:
存在两个activity : A, B,activity B 的 window 为 transparent, A 启动 B。这时 A 的 onStop() 不会被调用。
这是为什么?先来看看android的官方文档对activity的onStop()的一段描述。
When your activity is no longer visible to the user, it has entered the Stopped state, and the system invokes the onStop() callback
可见,activity只有在对用户不可见的时候,onStop() 才会被调用。而在上述情境中,B 为 transparent -> A 为 visible,因此 onStop() 不会被调用。