Detect when Android app is going to background

前端 未结 2 1943
闹比i
闹比i 2021-01-21 20:37

In my application I need to detect whether my application is going to background or is switching to another activity of the same application... I know that I have to use the onP

2条回答
  •  天命终不由人
    2021-01-21 20:48

    There is no direct approach to get the app status while background or foreground, but even i have faced this issue, and found the solution with onWindowFocusChanged and onStop. For more details: http://vardhan-justlikethat.blogspot.in/2013/05/android-solution-to-detect-when-android.html

提交回复
热议问题