title: Android: How to get return result from activity when calling from Fragment?
body: <p>I have a Fragment that calls another Activity using:</p>
  
  <pre><code>ProductEditionMaintenanceActivity.class);
  Bundle extras = new Bundle();
  extras.putString("productCode", productCode);
  extras.putInt("productEditionID", 0);
  intent.putExtras(extras);
  getActivity().startActivityForResult(intent, 1);
  </code></pre>
  
  <p>and return from the activity:</p>
  
  <pre><code>Intent resultIntent = new Intent();
  setResult(Activity.RESULT_OK, resultIntent);
  finish();
  </code></pre>
  
  <p>I tried to use the following in the Fragment</p>
  
  <pre><code>@Override
  public void onActivityResult(int requestCode, int resultCode, Intent data)
  {
      //Do something
  }
  </code></pre>
  
  <p>
  However, I am guessing the intent created passed the reference of the parent Activity of the Fragment therefore onActivityResult on the Fragment does not get called. 
  If that is the case, what do I need to do so the fragment get the result from the callee Activity?</p>