For me passing objects as serializable works very well.
I defined a user class:
Using java Syntax Highlighting
public class User implements Serializable{
private String name;
//Getter and Setter
}
Parsed in 0.030 seconds, using
GeSHi 1.0.8.4
Save the object in an activtiy with this code:
Using java Syntax Highlighting
Intent i = new Intent(this, newActivitiy.class);
Bundle b = getIntent().getExtras();
User u = new User();
u.setName("Michels");
b.putSerializable("testobject", u);
i.putExtras(b);
startActivity(i);
Parsed in 0.031 seconds, using
GeSHi 1.0.8.4
And get the object in the new Activity with this code
Using java Syntax Highlighting
Bundle b = getIntent().getExtras();
User u = (User) b.getSerializable("testobject");
String name = u.getForename();
Log.v("MyLog", "Name: "+name);
Parsed in 0.034 seconds, using
GeSHi 1.0.8.4
Works well for me. Any reasons why I shouldn't use that?