title: Android: setResult not returning result to Parent Activity
body: <p>I have started a child activity from parent activity using <strong>startActivityForResult</strong>. After performing required functions in child activity I am setting result using <strong>setResult</strong>. But I am not getting result at parent activity from child activity.</p>
  
  <p>Heres my code.</p>
  
  <p>Here is how I call my child activity from parent activity.</p>
  
  <pre><code> Intent i = new Intent(MainActivity.this, Child.class);
      i.putExtra("ID", intID);
      i.putExtra("aID", aID);
      i.putExtra("myMsg", myMsg);
      startActivityForResult(i, 1);
  </code></pre>
  
  <p>This is how I set result from my child activity.</p>
  
  <pre><code> @Override
      public void onBackPressed() {
          super.onBackPressed();
       Intent resultInt = new Intent();
       resultInt.putExtra("Result", "Done");
       setResult(Activity.RESULT_OK, resultInt);
       finish();
  }
  </code></pre>
  
  <p>This is my <strong>onActivityResult</strong></p>
  
  <pre><code>   @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
  
      if (requestCode == 1) {
  
          if (resultCode == Activity.RESULT_OK) {
              if(data!=null) {
                  Toast.makeText(MainActivity.this, "Data received", Toast.LENGTH_SHORT).show();
              }
          }
      }
  
  }
  </code></pre>
  
  <p>Here the when i check for <strong>resultCode==Activity.RESULT_OK</strong> is giving false.
  And I also checked for intent passed outside of this if condition and its returning null.</p>
  
  <pre><code> &lt;activity
          android:name=".MainActivity"
          android:label="Main"
          android:parentActivityName=".MainPage"
          android:theme="@style/AppTheme.NoActionBar"&gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="org.mydomain.mydomain.MainPage" /&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name=".Child"
          android:label="Child"
          android:parentActivityName=".MainActivity"
          android:theme="@style/AppTheme1"&gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="org.mydomain.mydomain.MainActivity" /&gt;
      &lt;/activity&gt;
  </code></pre>
  
  <p>Can anyone help me to fix this issue.</p>