result not set in onPause() using setResult() when pressing the Back button
<p>I have 2 activities AAA and BBB. I call BBB from AAA using <strong>startActivityForResult(Intent, int)</strong>. After I am done with BBB, I press the Back button to return to AAA. In BBB, I override onPause() and set the result by using <strong>setResult(RESULT_OK)</strong>. </p>

<p>In AAA, I check my result in <strong>onActivityResult(int requestCode, int resultCode, Intent data)</strong> and I keep getting RESULT_CANCELLED.</p>

<p>After spending sometime on google/stackoverflow, I figured out that if I override <strong>onBackPressed()</strong> and set the result in it, then it works absolutely fine. </p>

<p>What I fail to understand is that, why is the result not getting set in onPause(), when in fact onPause() gets called after onBackPressed(). I have gone through the activity flows in the Dev docs and I am pretty clear about what has been mentioned there.</p>

<p>Anyone got any ideas about this behavior or could explain it better? </p>
