Android: Tell When App Returns to Foreground
<p>I have an activity called <code>EntranceActivity</code> which routes to other activities based on a few different parameters. </p>

<p>This <code>Activity</code> is <code>ClearTop</code>-ed, such that I can <code>startActivity(...EntranceActivity...)</code> and re-route through the <code>EntranceActivity</code> logic without having to worry about little nuances. It is also the only entrance point to the application when returning to foreground.</p>

<p>I need to be able to determine when this <code>Activity</code> is being pushed to the foreground from the <code>beginning</code> (from first launch / from being in background) vs when I am routing to it during the app usage. (i.e. from <code>Activity2</code> back to <code>EntranceActivity</code>)</p>

<p>The following question shows how to determine if the app is in the foreground... but the <code>EntranceActivity</code> will only execute when the app is in the <code>Foreground</code>, so that does not seem to be what I'm looking for.</p>

<p><a href="http://stackoverflow.com/questions/5504632/how-can-i-tell-if-android-app-is-running-in-the-foreground">How can I tell if android app is running in the foreground? </a></p>
