title: Android: how to pass object between activities with object contains other objects
body: <p>I'm begginer in Android and i try to pass object between activities with object contains other objects but errors appear. </p>
  
  <p>A solution?</p>
  
  <p>I try to pass object with serializable :</p>
  
  <pre><code>        lALL.setOnItemClickListener(new OnItemClickListener() {
              @Override
              public void onItemClick(AdapterView&lt;?&gt; arg0, View v,
                      int position, long arg3) {
                  System.out.println(position);
                  Locataire l = new Locataire(getResources());
                  l.setNom("test");
                  l.setPrenom("test");
                  Intent intent = new Intent(MainActivity.this, Etat_lieux.class);
                  intent.putExtra("EDL", l);
                  startActivity(intent);      
              }
  
  
          });
  </code></pre>
  
  <p>And</p>
  
  <pre><code>public class Locataire implements Serializable{
  
  private String ref;
  private String civilite;
  private String nom;
  private String prenom;
  private Contact contact = new Contact();
  private Adresse adresse = new Adresse();
  private String DG;
  private boolean IsGarantPresent;
  private boolean IsColocation;
  
  private Resources res;
  
  public Locataire(Resources res)
  {
      this.res = res;
  }
  </code></pre>
  
  <p>Contact,Adresse</p>
  
  <p>public class Contact implements Serializable{</p>
  
  <pre><code>protected String tel;
  protected String mobile;
  protected String fax;
  protected String email;
  protected String www;
  </code></pre>
  
  <p>And ressource is Context getResources() of first activity</p>