Calling a new activity when threads running - IllegalThreadStateException
<p>I am developing a game which so far has involved just two activities: a splash screen and a main activity. The main activity starts up a new thread which handles the drawing and game mechanics. So far the game has been working nicely. Now I have just added a new button for the purposes of viewing a "high scores" page in a new activity. So I set up an onClick handler and when the button is clicked I call the following code:</p>

<pre><code>in = new Intent("android.intent.action.HIGH");
startActivity(in);
</code></pre>

<p>and in the high scores activity I have an [Ok] button which instigates the following:</p>

<pre><code>back_but.setOnClickListener(new OnClickListener()
{   
    public void onClick(View arg0)
    {
        finish();
    }
});
</code></pre>

<p>When I click the button to view the high scores, the high scores activity starts up fine, unfortunately when I click the [Ok] button the program crashes with an IllegalThreadStateException.</p>

<p>Should I have stopped or paused the game thread in the main program before calling the new activity?</p>
