title: Why does onActivityResult return, but I am getting the correct requestCode?
body: <p>I'm building an application where the first Activity starts another one by <code>startActivityByResult</code>. After some setting is done, I need to send the setting result back.</p>
  
  <p>So I override the second Activity's <code>onPause()</code> method, I get the intent, <code>putExra</code>, and send it back through <code>setResult()</code>.</p>
  
  <p>Back to the first Activity. <code>onActivityResult</code> has definitely been called. I got the resultCode set before, but the intent data is null. I can't figure out what's wrong.</p>
  
  <p>Here's my code:</p>
  
  <p>The first Activity</p>
  
  <pre><code>    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      Log.e("page1", requestCode + "_");
      Log.e("page1", resultCode + "_");
      Log.e("page1", (data == null) + "_");
      // if ((requestCode == 1) &amp;&amp; (data != null)) {
      if (data != null) {
          String size = data.getStringExtra("size");
          Log.e("switch", size + "_");
          switch (size.charAt(0)) {
          case '1': {
              text.setTextSize(10);
          }
              break;
          case '2': {
              text.setTextSize(20);
          }
              break;
          case '3': {
              text.setTextSize(30);
          }
              break;
          }
      }
  }
  </code></pre>
  
  <p>My second Activity</p>
  
  <pre><code>    @Override
  protected void onPause() {
  
      Intent intent = getIntent();
      Log.e("prefs", (intent == null) + "_");
      intent.putExtra("size", size);
      setResult(3, intent);
      super.onPause();
  }
  </code></pre>
  
  <p>I've tested in LogCat. In the second Activity. The intent about to be sent is definitely not null. But when it goes to the first Activity. Null just returned. This is driving me really crazy.</p>