title: How to pass extras from an intent to onActivityResult() method?
body: <p>I'm trying to pass some data from an intent to <code>onActivityResult()</code> method, this is what I did:</p>
  
  <pre><code>Intent intent = new Intent();
  intent.putExtra("STRING", some_data);
  startActivityForResult(intent, 1);
  </code></pre>
  
  <p>then:</p>
  
  <pre><code>@Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
  
      Log.d(TAG, "onActivityResult: " + data.getStringExtra("STRING"));
      // or
      Log.d(TAG, "onActivityResult: " + data.getExtras().getString("STRING"));
  
  }
  </code></pre>
  
  <p>but this keeps giving me a NullPointerException <code>(data == null)</code>, did I miss something?</p>