Stop method execution until another activity finished
<p>Good day to everyone!</p>

<p>I need to stop method execution until another activity will end.
At the moment I'm trying to do it in this way:</p>

<pre><code>    private boolean isPausedWhileSplash;

public void showSplashWorldChangeAd(String oldWorldName, String newWorldName) {
    overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
    Intent intent = new Intent(this, SplashScreen.class);
    intent.putExtra(SplashScreen.MSG_STRING_KEY, oldWorldName + " -&gt; "
            + newWorldName);
    intent.putExtra(SplashScreen.OLD_WORLD, oldWorldName);
    intent.putExtra(SplashScreen.NEW_WORLD, newWorldName);
    startActivityForResult(intent, RESULT_OK);
    isPausedWhileSplash = true;
    while (isPausedWhileSplash) {
    }
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    isPausedWhileSplash = false;
}
</code></pre>

<p>But it's not working.</p>

<p>Can you help me?</p>

<p>Thanks!</p>

<p><strong>UPD:</strong> Maybe there is any way to prevent view from drawing? Because all what I need right now is delay calling of methods, which will redraw view of this activity. Now I have the new world drawn before the splash screen, saying about the world change, is shown, which is not looking good.</p>
