在我的应用程序中,有几种情况我应该知道哪些活动对用户可见。
- 是否有让用户看到当前活动的功能?
现在我正在做的是创建一个带有静态变量的类,例如
布尔静态 mainActivityIsVisible = false;
在 onResume() 和 onPause() 内的真/假之间切换;因此,其他活动可以检查此变量以找出答案。
Does the same apply to check if an activity is stopped or destroyed ? Or is there a way to check the activities from the stack of the app ?
最后
How can I find that the last activity's onDestroy() was called. My objective from this is to find out if the app has totally exited and does not have any activities running, nor is minimized.
这个问题可以改写为
How can I know my activity is not running."
和
How can I know my activity is running but not visible to the user ?