title: NullPointerException from getExtras()
body: <p>I'm creating an intent to transfer data from one activity to another like this : </p>
  
  <pre><code>Intent intent = new Intent(this, ActivityHighScore.class);
      intent.putExtra("USERNAME", username);
      intent.putExtra("PLAYERMOVES", playerMoves);
  
      this.startActivity(intent);
  </code></pre>
  
  <p>Then i want to check if all of this data exists as the activity starts, as it can be started from other sources without this data being set. Im using this statement:</p>
  
  <pre><code>        Bundle bundle = getIntent().getExtras();
  
      if (!bundle.getString("USERNAME").equals(null) &amp;&amp; bundle.getInt("PLAYERMOVES") != 0){
          String username = bundle.getString("USERNAME");
          int playerMoves = bundle.getInt("PLAYERMOVES");
          addHighScore(username, playerMoves);
  
      }   
  </code></pre>
  
  <p>But this causes a null pointerexception and I'm entirely sure how. I thought I was getting to grips with Strings and .equals(), but I think its that... Any help would be greatly appreciated. Thanks.</p>