title: How to start game over activity? (android studio)
body: <p><strong>Goal</strong>
  display Game over screen when health = 0;</p>
  <p><strong>Steps</strong></p>
  <ol>
  <li>create new activity (GameOver.class)</li>
  <li>create layout for GameOver activity</li>
  <li>create new activity in AndroidManifest.xml</li>
  </ol>
  <pre><code>       &lt;activity
             android:name=&quot;.GameOver&quot;
             android:exported=&quot;false&quot; /&gt;
  </code></pre>
  <ol start="4">
  <li>when player dies new activity is called</li>
  </ol>
  <pre><code>            if(player.heart == 0){
                  Intent gameOverIntent = new Intent(context, MainActivity.class);
                  context.startActivity(gameOverIntent);
              }
  </code></pre>
  <p><strong>Error</strong>
  However I get this error...</p>
  <pre><code>   Process: com.example.breakoutgame, PID: 21386
     java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.Canvas.drawColor(int, android.graphics.PorterDuff$Mode)' on a null object reference
         at android.view.SurfaceView.clearSurfaceViewPort(SurfaceView.java:665)
         at android.view.SurfaceView.dispatchDraw(SurfaceView.java:610)
         at android.view.View.draw(View.java:22353)
         at android.view.SurfaceView.draw(SurfaceView.java:601)
         at com.example.breakoutgame.Game.draw(Game.java:84)
         at com.example.breakoutgame.GameLoop.run(GameLoop.java:57)
  </code></pre>
  <p>Maybe I missed some step?</p>