title: error with sending object to another activity
body: <p>my app always crashes when i send an object to the main activity. I want it so the main activity displays a String from my class but everytime I press the row in the second activity and go back to the main activity the app crashes can someone please help me to fix this, thanks.</p>
  
  <p><strong>my class below</strong> </p>
  
  <pre><code>public class Ship implements Serializable {
  
  
  public String test()
  {
      String s = "Hello Android!";
      return s;
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>Second Activity</strong></p>
  
  <pre><code> hangarList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; adapterView, View view, int position, long l) {
  
  
             Intent sendListEvents = new Intent();
             if(position == 1)
             {
  
                 Ship test = new Ship();
                 sendListEvents.putExtra("ship1", test);
  
             }
              //insert position events ^^^
              setResult(RESULT_OK, sendListEvents);
  
  
   }
      });
  </code></pre>
  
  <p><strong>Main Activity below</strong></p>
  
  <pre><code>    @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      if (requestCode == result) {
  
          if (resultCode == RESULT_OK) {
  
              Intent getData = getIntent();
              Ship ship1 = (Ship) getData.getSerializableExtra("ship1");
              String s = ship1.test();
              test.setText(s);
  
          }
      }
  </code></pre>
  
  <p>}</p>