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
Updated 30 November 2021
In Android, to pass the data from one activity to another activity, we use the Parcelable. The kotlin-parcelize plugin provides a Parcelable implementation generator.
The Android’s Parcelable is an interface on which, the values can be written and read from a Parcel. The implementation of the Parcelable interface allows an object to be passed between the different Android components like, activity and fragment.
To include support for Parcelable, add the following Gradle plugin to your app’s build.gradle file:
To achieve this your class must implement the Parcelable and override some methods.
When the model class is having a variable list of custom Class then, the used class must also implement the Parcelable interface.
When implementing the constructor for the Parcel and writeToParcel method always make sure the implementation of variable position should be same on the both method.
You can also use the @Parcelize annotation so that you don’t have to override the above methods:
The @Parcelize annotation Instructs the Kotlin compiler to generate the writeToParcel(), and describeContents() methods, also the CREATOR factory class automatically.
You can also check out the official documentation provided by Google click here.
. . . . . . . . .
That’s it from my side for today, thanks for reading it until now. You can check our other android blogs Click Here.
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
Name
Email
Subject
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.