I am trying to work on sending an object of my customer class from one Activity
and display it in another Activity
.
The code for t
If you choose use the way Samuh describes, remember that only primitive values can be sent. That is, values that are parcable. So, if your object contains complex objects these will not follow. For example, variables like Bitmap, HashMap etc... These are tricky to pass by the intent.
In general I would advice you to send only primitive datatypes as extras, like String, int, boolean etc. In your case it would be: String fname
, String lname
, int age
, and String address
.
My opinion: More complex objects are better shared by implementing a ContentProvider, SDCard, etc. It's also possible to use a static variable, but this may fastly lead to error-prone code...
But again, it's just my subjective opinion.