NumberFormatException when passing variable through Android Intent
<p>I'm trying to pass 2 variables through a couple of Android Activities. One of them keeps turning up as null on the last page:</p>

<p>The first Activity:</p>

<pre><code>Intent intent= new Intent(RoundOptionActivity.this, MoveOptionActivity.class);
intent.putExtra("numRounds", "5");
startActivity(intent);
</code></pre>

<p>The second Activity:</p>

<pre><code>Bundle extras = getIntent().getExtras(); 
if(extras !=null) {
    numRounds = Integer.parseInt(extras.getString("numRounds"));
}

.........

Intent intent = new Intent(MoveOptionActivity.this, MoveActivity.class);
intent.putExtra("numRounds", numRounds);
intent.putExtra("playerChoice", playerChoice);
startActivity(intent);
</code></pre>

<p>(Note that at this point I printed numRounds in LogCat and it was set to the right number, and not null)</p>

<p>The Third Activity:</p>

<pre><code>Bundle extras = getIntent().getExtras(); 
if(extras !=null) {
    playerChoice = Integer.parseInt(extras.getString("playerChoice"));
    numRounds = Integer.parseInt(extras.getString("numRounds"));
}
</code></pre>

<p>At this point, the application crashes at the line where I try to parse numRounds to an integer, with a NumberFormatException complaining that it can't parse a null value. There's never a problem with playerChoice, only numRounds. I've tried handling numRounds the exact same way as playerChoice, but nothing seems to work. What's going on? D:</p>
