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
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