Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
There is the problem, how can pass the custom class (POJO) object data or list data from one Activity to another activity via intent.?
We can be done it very easily by using Parcelable Interface. We implement Parcelable Interface and override its methods in our POJO classes and pass our POJO class object by intent.putExtra(“key”, object) or list of Parcelable object intent.putParcelableArrayListExtra(“key”, object_list).
For example-
and get this object in NewViewSimpleProduct Activity as-
But after getting the parcel object on receiving Activity, we can get a null value for all members of the object. So, how we solve this mistake?
This is the normal mistake we can solve it only few work to take care. i.e. we just Override writeToParcel() method and write the value of all members in synchronous, we will get all members value just add a constructor with Parcel argument and assign values to all object members in this constructor in synchronous form as we write in writeToParcel() method.
for Example-
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
The results provided were above our expectations both in deliverability timeline as well as operation. They are a top-notch company with many resources and a company we feel honoured to work with again!
Lee Seward
Founder, Gro-Connect
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.