title: Activity calls another activity and must resume again after another activity finishes
body: <p>I'm new to Android. My problem is:</p>
  
  <ol>
  <li>Activity A calls activity B in the middle of its execution</li>
  <li>Activity B must start and complete its execution</li>
  <li>Only then activity A must resume (not restart)</li>
  </ol>
  
  <p>Activity A has a loop. Somewhere in the middle of loop, Activity B is called, and once B finishes, A should resume the loop from where it left off. </p>
  
  <p>I tried to code this, but what happens right now is that Activity A calls B, but B is not entered, then A resumes the loop and again calls B. </p>
  
  <p>Essentially, the calls to B are stacked and once the loop in A completes, one by one the calls to B in stack are executed, so finally the first call to B is executed last in a last-in first-out order. I just want to execute B once, at the appropriate time.</p>
  
  <p>Can anyone help me?</p>