title: Using startActivityForResult across Android applications
body: <p>I have written an application that has an <code>&lt;intent-filter/&gt;</code> so that other applications can start it using <code>startActivityForResult()</code>. When this activity is finished it has created an object that is like:</p>
  
  <p>(Application A)</p>
  
  <pre><code> public class MyObject implements Serializable {
        private String name;
        private String[] items
   }
  </code></pre>
  
  <p>And set's it on the result:</p>
  
  <p>(Application A)</p>
  
  <pre><code> getIntent().putExtra("Extra_MyObject", myObject);
   setResult(RESULT_OK, getIntent());
  </code></pre>
  
  <p>So the second activity that is recieving this intent has an issue, <strong>how does it know the name of the intent extra to receive</strong> and <strong>how would I create the object received</strong> and cast it back into a <code>MyObject</code> that is not part of of this application?</p>
  
  <p>(Application B)</p>
  
  <pre><code>  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      if(requestCode == MY_REQ_CODE){
          if(resultCode == RESULT_OK){
                   // So here how do I know what the intent data name is i.e. "Extra_MyObject"
                   // and how would I know the structure to cast the object back to a MyObject that isn't part of this project?
  
          }
      }
  }
  </code></pre>
  
  <p>Would I just mimic the <code>MyObject</code> class in the second application and cast it to that?
  or are there other options?</p>