title: Android Game States Change when paused
body: <p>In a semi traditional fashion,  I have a single activity game (MainActivity) with a single surface view (MainSurface).  I set up two "game states" that render themselves to the surface view canvas (SplashState and ModelState).  </p>
  
  <p>When the application starts the surface view hands itself over to the splash state to so it can draw itself to the screen like this.</p>
  
  <pre><code>SurfaceHolder holder = getHolder();
          holder.addCallback(new SurfaceHolder.Callback() {
              @Override
              public void surfaceCreated(SurfaceHolder holder) {
                  initInput();
                  if(currentState == null){
                      setCurrentState(new SplashState());
                  }
                  initApp();
              @Override
              public void surfaceChanged(SurfaceHolder holder, int format, int         width, int height) {
  
              }
  
              @Override
              public void surfaceDestroyed(SurfaceHolder holder) {
                  pauseApp();
              }
          });
  
  private void pauseApp(){
          running = false;
          while(appThread.isAlive()){
              try{
                  appThread.join();
                  break;
              } catch (InterruptedException e){
  
              }
          }
      }
  </code></pre>
  
  <p>When the user touches the splash screen, it calls to the SurfaceView to change the state to the ModelState (which is the primary state of the application) with this</p>
  
  <pre><code>@Override
      public boolean onTouch(MotionEvent e, int scaledX, int scaledY) {
          setCurrentState(new ModelState());
          return false;
     }
  </code></pre>
  
  <p>All of this works great.  But when I let my device sleep, or use another application then open my app back up, sometimes I get the ModelState, and sometimes I get the SplashState.  Can anyone explain why?  I feel like there is more I should be doing to save the current state of the application when it pauses and resumes so it is sure to start back in the same spot.  Any help would be appreciated.</p>