Intent's intended class can't read extended information from said intent
<p>I am trying to send information from my main activity class to another class in my app package. The information is used to update an AlertDialog automatically. Here is the code I've been working with:</p>

<pre><code>//This is in MainActivity.class
//Tests to see if SyncDialog will update itself with new intents.
public void testLoop() {
    int n = 0;
    Intent intent = new Intent(this, SyncDialog.class);
    while (n != 10) {
        intent.putExtra(TEST_NUMBER, n);
        n++;
    }
}

//This is in SyncDialog.class
//This method should get the int value from MainActivity
protected void onNewIntent(Intent intent) {
    int n = intent.getIntExtra(TEST_NUMBER, 0);
    showNextDialog(n);
}
</code></pre>

<p>TEST_NUMBER is defined as a public constant at the top of MainActivity, and I even tried importing MainActivity into SyncDialog.class.</p>

<p>Is there any way to fix this?</p>
