title: Will startActivityForResult() always lead to onActivityResult() called before anything else?
body: <p>I know this question seems vague, so please bear with me.</p>
  
  <p>I'm working with nested fragments using the v4 support library and running into the bug described <a href="https://code.google.com/p/android/issues/detail?id=40537" rel="nofollow">here</a> in which results from <code>startActivityForResult()</code> are not routed to the correct child fragment. In that thread, users propose several workarounds, and two of them (replies <a href="https://code.google.com/p/android/issues/detail?id=40537#c8" rel="nofollow">#8</a> and <a href="https://code.google.com/p/android/issues/detail?id=40537#c12" rel="nofollow">#12</a>) describe solutions which are based on associating a request code with the path to the nested fragment that made a <code>startActivityForResult()</code> call, and then when <code>onActivityResult()</code> is called, looking up the path by the request code and routing the result to the correct activity.</p>
  
  <p>This approach seems like it could run into problems if several child fragments made calls using the same request code because it would be ambiguous which child to route results to with that code. However, this would not be an issue if we know for sure that whenever we call <code>startActivityForResult()</code>, that <code>onActivityResult()</code> will always be called before the fragment gets a chance to call <code>startActivityForResult()</code> again.</p>
  
  <p>So my question is, is this a reasonable assumption to make? My mental model for <code>startActivityForResult()</code> is that we pause the current activity, do something else, and then immediately upon resuming we get the activity result. Is this correct, or is there some situation where <code>onActivityResult()</code> will not be called until some time later after resuming? Are there realistic situations where I would call <code>startActivityForResult()</code> from a fragment and then call it a second time from the same fragment before I get a result from the first activity?</p>