How can i make my data class in kotlin parcelable?

Example:

data class User(val name: String, val age: Int)
Solution:

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize

@Parcelize
data class User(val name: String, val age: Int) : Parcelable
For a data class to be `Parcelable`, you need to annotate it with `@Parcelize` and also implement the `Parcelable` interface. Ensure you have the `kotlin-android-extensions` plugin added.

Beginner's Guide to Kotlin