• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to pass object using intent?

 
Viswan Nathan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

How to pass objects (which is object of object) using intent from one activity to another activity.

For example i have the following classes

class Customer {

CustomerType type[];
string customername;

}

class CustomerType {

int id;
String type; example it will hold domestic customer / international customer

}

I have tried using parcelable interface to send the object from one activity to another activity. But i could not able to get it. Is there any other approach/ sugesstions on the same.

Regards,
Viswanathan.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But i could not able to get it.

Which means what, exactly? TellTheDetails
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using Intent.putExtra(); you will have to make your classes implement the Parcelable interface. It would help if you showed ALL of the code you tried - neither of the classes you posted implement Parcelable. And also show the call to putExtra().
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!