title: Passing data to main activity is lost
body: <p>That issue took me few days of head-banging with no avail. In short I have two <code>Activities</code> for sake of the example I'll call them <code>MainActivity</code> and <code>SearchActivity</code>. The <code>MainActivity</code> has a button that takes you to a search screen which is the <code>SearchActivity</code> and there I have a button with preset value that I want to pass back to the <code>MainActivity</code>. So far so good. I click the button in debugger I can see my extra values and next breakpoint is in the onCreate in <code>MainActivity</code> when I get the extras there is nothing, none, all gone. SO here is the important part, the code:</p>
  
  <p><strong>MainActivity.class</strong></p>
  
  <pre><code>public class MainActivity extends Activity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
  
          btnSearch.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent search = new Intent(v.this, SearchActivity.class);
                  startActivityForResult(search, SEARCH_VIDEO_REQUEST);
              }
          });
      }
  
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          if (requestCode == SEARCH_VIDEO_REQUEST) {
              if (resultCode == RESULT_OK) {
                  String url = data.getExtras().getString("VIDEO_URL");
                  if (url != null) {
                      txtUrl.setText(url);
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p><strong>SearchActivity.class</strong></p>
  
  <pre><code>public class SearchActivity extends Activity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          btnSend.setOnClickListener(new View.OnClickListener() {
              public void onClick(View v) {
                  String videoUrl = "http://video-url.com";
                  Intent data = new Intent(SearchActivity.this, MainActivity.class);
                  data.putExtra("VIDEO_URL", videoUrl);
                  setResult(RESULT_OK, data);
                  finish();
              }
          });
      }
  }
  </code></pre>
  
  <p><strong>AndroidManifest.xml</strong></p>
  
  <pre><code>&lt;activity
      android:name="com.project.MainActivity"
      android:label="@string/app_name"
      android:configChanges="keyboardHidden|orientation|screenSize"
      android:theme="@android:style/Theme.Black.NoTitleBar"
      android:screenOrientation="portrait"&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.MAIN"/&gt;
          &lt;category android:name="android.intent.category.LAUNCHER"/&gt;
      &lt;/intent-filter&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.SEND"/&gt;
          &lt;category android:name="android.intent.category.DEFAULT"/&gt;
          &lt;data android:mimeType="text/plain"/&gt;
      &lt;/intent-filter&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.MEDIA_MOUNTED"/&gt;
          &lt;data android:scheme="file"/&gt;
      &lt;/intent-filter&gt;
  &lt;/activity&gt;
  &lt;activity
      android:name="com.project.SearchActivity"
      android:label="@string/app_name"
      android:theme="@android:style/Theme.NoTitleBar"
      android:screenOrientation="portrait"&gt;
  &lt;/activity&gt;
  </code></pre>