Android App Development
iOS 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 188.8.131.52 release ready!
Owner and Founder. Opencart
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*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Great Product, Great Team, and Great Support Service. And if you want to add more features to the product, they can submit any idea that comes to your mind. They really care about their clients and we are really happy and honored to deal with Webkul.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.