Android switching between activities
<p>I currently have an activity called RaceActivity in my app which performs a setContentView() to display a surface view. 
Inside of my surface view I am checking to see if the user has won my game and when he/she has I would like to switch to another view that shows a simple game finished message. I have tried using:</p>

<pre><code>Intent intent = new Intent();         
intent.setClass(getContext(), RaceActivity.class); 
intent.putExtra("code", 3);
((Activity)getContext()).startActivityForResult(intent, 5);
</code></pre>

<p>But this doesn't work for me. It shows the new view for a second then the screen goes black and it continues to execute the code on the previous surface view (I have a log statement so that I can see what it's doing).</p>

<p>How do I switch to the finish view and make it stop the previous view?</p>
