Want android app to wait until user presses a button before continuing
<p>I have a game for android, and when the user wins, it shows a dialog asking if they want to play again.  If they say "no", the application exits, and if they say "yes", it starts another game.  The problem is that a new game starts as the dialog is displayed, instead of waiting for the user to press a button.  The code is like this:</p>

<pre><code>if (won) {
    showDialog(DIALOG_WON_ID);
    imageAdapter.initializemThumbIds();  // this starts a new game
}
</code></pre>

<p>I don't want the start-new-game line to execute until the dialog is dismissed.</p>
