title: Fragments startActivityForResult always return resultCode 0 and intent null on callback onActivityResult
body: <p>I searched all over and there are similar posts about it, but can't find a solution!</p>
  
  <p>My situation is I have an Activity A that holds a <code>fragment</code>, and from that <code>fragment</code> I want to start a new <code>Activity</code> B that should return some values to the <code>fragment</code>.</p>
  
  <p>On the <code>fragment</code></p>
  
  <pre><code>startActivityForResult(mapIntent, ConstantsUtils.TOMAP_REQUEST_CODE);
  </code></pre>
  
  <p>On the <code>Activity</code> B, to return the data</p>
  
  <pre><code>Intent returnIntent = new Intent();
  returnIntent.putExtra(SerializationConstants.isSearchSaved, mAbItemsShown.ordinal());
  setResult (ConstantsUtils.SUCCESS_RETURN_CODE, returnIntent);
  finish();
  </code></pre>
  
  <p>On the fragment</p>
  
  <pre><code>@Override
  public void onActivityResult(int requestCode, int resultCode, Intent intent) {
      super.onActivityResult(requestCode, resultCode, intent);
  
  switch (requestCode) {
  
      case ConstantsUtils.TOMAP_REQUEST_CODE:
  
              if (resultCode == ConstantsUtils.SUCCESS_RETURN_CODE) {
                //do some stuff 
              }
      }
  }
  </code></pre>
  
  <p><code>onActivityResult</code> from the <code>fragment</code> is successfully called, with the right <code>requestCode</code> but <code>resultCode</code> is always 0 and intent is always <code>null</code>.</p>
  
  <p>I have no other <code>onActivityResult</code> implementation under <code>Activity</code> A.</p>
  
  <p>In fact, I also try starting the <code>activity</code> from the <code>fragment</code> with 
  <code>getActivity().startActivityForResult(mapIntent, ConstantsUtils.TOMAP_REQUEST_CODE);</code>
  and implementing <code>onActivityResult</code> on <code>Activity</code> A but it happens the same, right <code>requestCode</code> but wrong <code>resultCode</code> and <code>intent</code>.</p>
  
  <p>I'm using <code>Sherlock Action Bar</code> so my <code>fragment</code> is a <code>SherlockListFragment</code> so I'm using the <code>support library (r18)</code>.</p>
  
  <p>Can you help me? Thanks</p>