title: Android Change Layout from SurfaceView
body: <p>I am making an app with a login screen which then goes to a surfaceview where the game is played. The problem is that the user can be logged out while playing and I need to be able to return the user to the login screen. How would I do this?</p>
  
  <p>I've tried adding this to the surfaceview, but it doesn't do anything:</p>
  
  <p><code>((Activity)getContext()).setContentView(R.layout.login);</code></p>
  
  <p>EDIT:</p>
  
  <p>Issue is solved, here is the code I added in surfaceview:</p>
  
  <pre><code>        Intent intent = new Intent();
          intent.setClass(getContext(), BattleLogin.class);
          ((Activity)getContext()).startActivityForResult(intent,loginResult);
  </code></pre>
  
  <p>It may be important to mention to, don't forget to add the new activity to the manifest.</p>