Android Activity lifecycle conflict
<p>I've an app with 3 activities</p>

<pre><code>LoginActivity
ActivityA
ActivityB
</code></pre>

<p>User starts with LoginActivity. After successful login, he goes to ActivityA. ActivityA invokes ActivityB using startActivityForResult and processes the response using onActivityResult. </p>

<p>If user presses 'Home' button from ActivityA or ActivityB and relaunches the application, I want to take user back to LoginActivity</p>

<p>I tried playing around with onRestart and onResume. Both of these are called when ActivityA  is reinitialized via home screen or onActivityResult (when user comes back from ActivityB).</p>

<p>How can I implement this requirement? </p>

<p>PS: I checked similar questions on SO and did not find something that matches my requirement.</p>

<p>Thanks.</p>
