title: Determine if any of the activities are visible or not (app in background)
body: <p>Is there a way to determine if any of the activities are visible or not (the situation when the app is in the background). I'm trying to implement un-logging mechanism without sessions and I did handle the situations when the screen is off / locked, timeout, pressing the home button, but when another app is being launched and putting my app in the background, well there's the problem.</p>
  
  <p>Or a way to check if an activity is being paused because there's an intent were called to open a new activity. This way, say I have three activities <code>A</code>, <code>B</code>, <code>C</code> and currently <code>B</code> is opened. So,</p>
  
  <pre><code>@Override
  protected void onStop() {
    if (startActivityCalled) {
      // it continues to activity `C` or any else for that matter
    } else {
      // if screen were locked, for example
      // it goes to the activity `A` and finishes the current activity
    }
  }
  </code></pre>