title: PutExtra doesn't work on the retriever side
body: <p>I want to sent intent from one first activity to another.</p>
  <p>The first activity sends an intent to the second activity in order to create a new AlertDialog, receive  a number from the user and send the number back to the first activity, that's where putExtra data to failed.</p>
  <p>The code of the first activity: GuessItActivity.java</p>
  <pre><code>                    Intent intent = new Intent(GuessItActivity.this,
                          AlertDialogMessage.class);
                  intent.addFlags(Intent.FILL_IN_DATA);
                  intent.addFlags(Intent.FILL_IN_CATEGORIES);
                  intent.addFlags(Intent.FILL_IN_ACTION);
                  
                  intent.putExtra(&quot;data1&quot;, 15);
                  startActivityForResult(
                          intent,
                          getResources().getInteger(
                                  R.integer.ALERT_DIALOG_MESSAGE));
  </code></pre>
  <p>on the retriever side , e.g the second activity side on  AlertDialogMessage.java</p>
  <pre><code>                            public void onClick(DialogInterface dialog,
                                  int which) {
                              // &quot;OK&quot; button pressed
                              int userGuess = Integer.parseInt(input
                                      .getText().toString());
                              Intent intent = getIntent();
                              if (intent == null)
                                  return;
  
                              int data1 = intent.getIntExtra(&quot;data1&quot;, -1);
                              if (data1 != 15 )
                                  return; // data1 ==15 
                              
                              intent.putExtra(&quot;data2&quot;, 25);           
                              if (getParent() == null) {
                                  setResult(Activity.RESULT_OK, intent);
                              } else {
                                  getParent().setResult(Activity.RESULT_OK,
                                          intent);
                              }
                              finish();
  </code></pre>
  <p>The first activity side: back to GuessItActivity.java</p>
  <pre><code>    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == getResources().getInteger(
              R.integer.ALERT_DIALOG_MESSAGE)) {
          if (resultCode == RESULT_OK) {
              Intent intent = getIntent();
              if (intent==null)
                  return; 
  
  
                Bundle extra = getIntent().getExtras();
              if (extra != null) {
                  int _data1 = extra.getInt(&quot;data1&quot;);
                  int _data2 = extra.getInt(&quot;data2&quot;);
              }
                 // extra  == null , what am I doing wrong  ? 
  
              int data1 = intent.getIntExtra(&quot;data1&quot;,-1);
              int data2 = intent.getIntExtra(&quot;data2&quot;,-1);
              if ((data1==-1)&amp;&amp;(data1==-1))
                  return; 
  </code></pre>
  <p>The problem is , that I receive data1 and data2 equal to -1.</p>
  <p>I'd like to receive the data the I put on the second activity. e.g data1 == 15 and data2 == 25</p>
  <p>What am I doing wrong?</p>