title: Android Intent putExtra(String, Serializable)
body: <p>I'm sorry if this Question is already answered, i searched a lot, but i couldn't find any question with my problem.</p>
  
  <p>I'm writing an android app which gets data from an internet database. My first activity retrieves the data from the database, and i try to pass a reference to the whole database to another activity.</p>
  
  <p>it briefly looks briefly like this:</p>
  
  <pre><code>//server is wrapper class for my database connection/ data retrieving
  Server server = new Server(...connection data...);
  server.connect();
  server.filldata();
  </code></pre>
  
  <p>And after that i try to pass this to another activity</p>
  
  <pre><code>Intent intent = new Intent(this, OtherActivity.class);
  intent.putExtra("server", server); //server, and all implements Serializable
  startActivity(intent);
  </code></pre>
  
  <p>And after this i get a java.lang.reflect.InvocationTargetException without explanation, what the problem could be.</p>
  
  <p>Please if you know a way to pass an Object (except for int, string...) to another activity, help me!</p>