title: Returning to an activity after surfaceview/thread has crashed :s
body: <p>I have set up a program where one activity (a menu) calls another menu. This menu can then call various activities each starting a different GamePanel/thread. Pressing the arrow return button after this goes back to the menu however they have crashed and can no longer be used.</p>
  
  <p>On a second point, in the first section of code, i cannot set the intent in the listener, as eclipse demands the Intent parameters are empty hence i create the pressed method, any explanations/resolutions? Thanks in advance to all!</p>
  
  <p>Calling from menu:</p>
  
  <pre><code>private OnClickListener L1Listen = new OnClickListener(){
  
  public void onClick(View arg0) {
      L1Pressed();
  }
  
  };
  
  public void L1Pressed()
  {
  Intent intent = new Intent(this, L1Started.class);
  startActivity(intent);
  
  }
  </code></pre>
  
  <p>called from menu:</p>
  
  <pre><code>package SortItOut.sortitout;
  
  import android.app.Activity;
  import android.os.Bundle;
  
  public class L1Started extends Activity{
  
   public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(new MainGamePanelL1((this)));
   }
  
  
  
  
   protected void onDestroy()
   {
   super.onDestroy();
   }
  
   protected void onStop()
   {
   super.onStop();    
   }
  
  }
  </code></pre>
  
  <p>Panel constructor (implements SurfaceHolder.callback)</p>
  
  <pre><code>public MainGamePanelL1(Context context){
      super(context);
      getHolder().addCallback(this);
  
      thread = new MainThreadL1(getHolder(), this);
      setFocusable(true);
  </code></pre>
  
  <p>Thread</p>
  
  <pre><code>package SortItOut.sortitout;
  
  
  import android.graphics.Canvas;
  import android.view.SurfaceHolder;
  
  public class MainThreadL1 extends Thread {
  
  private boolean running;
  private SurfaceHolder surfaceholder;
  private MainGamePanelL1 gamepanel;
  int y;
  
  
  public void setRunning(boolean running)
  {
      this.running = running;
  }
  
  public MainThreadL1(SurfaceHolder surfaceholder, MainGamePanelL1 mainGamePanelL1)
  {
  this.surfaceholder = surfaceholder;
  this.gamepanel = mainGamePanelL1;
  }
  
  
  public void run()
  {
      Canvas canvas;
      while(running)
      {
          canvas = null;
          try{
          canvas = this.surfaceholder.lockCanvas();
          synchronized(surfaceholder)
          {
              gamepanel.Check();
              this.gamepanel.onDraw(canvas);
  
          }
  
          }finally
          {
  
              if(canvas != null)
              {
                  surfaceholder.unlockCanvasAndPost(canvas);
              }
          }
  
      }
  }
  
  
  
  
  }
  </code></pre>